Desktop development is definitely here to stay as our WinForms controls just keep getting better. The latest release of Studio for WinForms 2011 v1 introduces 3 new controls and adds enhancements to over 10 controls. See what's new. Read below to get a deeper scoop into some of the top new features.
Grouping appointments in C1Schedule was one of the top requests by developers. Now you can easily create multi-user scheduling applications where appointments are grouped into distinct columns for each resource, contact or category. This feature supports paging so there's no limit to the number of groups.
If your data model supports an owner field, you can also group on that. C1Schedule has a new Owner property on its Appointment class so you can bind this to a field in your data and then group by this field. In this case you would set the GroupBy property to "Owner" and then supply mapping between your data set and the scheduler. Check out the Grouping and MultiUser samples, which install with the Studio, for full code.
Familiar with C1SuperTooltip? Well now we've taken the same rich, html formatting functionality and put it in the new C1SuperErrorProvider. This new control works just like the standard ErrorProvider except it allows you to display messages using html formatting. Make error messages clearer to the user by displaying rich fonts, decorators and images in the error tooltips.
In the TextBox (textBox1) TextChanged event, paste the following code:
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length < 10)
{
c1SuperErrorProvider1.SetError(textBox1,
"<strong>This is a <span style="color: red;">required</span> field.</strong>"
"Must be at least 10 characters.");
}
else
{
c1SuperErrorProvider1.SetError(textBox1, "");
}
}
Run the form and start typing into the TextBox.
C1Ribbon now supports multi-colored contextual tabs. You may designate some controls on the Ribbon to only be used in conjunction with a specific object or function on the form, such as a picture, chart or table. You can configure contextual tabs to only appear when a relevant object is selected or a specific action performs. The new ContextualTabGroups collection is available for adding and managing contextual tabs. Toggle each tab groups' visibility in code with the Visible property.
In the Enter event for each TextBox, paste the following code:
private void textBox1_Enter(object sender, EventArgs e)
{
ribbonContextualTabGroup1.Visible = true;
ribbonContextualTabGroup2.Visible = false;
}
private void textBox2_Enter(object sender, EventArgs e)
{
ribbonContextualTabGroup1.Visible = false;
ribbonContextualTabGroup2.Visible = true;
}
Run the form and notice that a different contextual tab group appears depending on which textbox has focus.
Notice in this sample we show and hide contextual tab groups only when objects receive focus so that when the Ribbon receives focus it does not disrupt our logic.