2 Answers, 1 is accepted
Hi Bonnie,
I can suggest you two ways to have no item selected in the RadDropDownList. The first way is to use the CurrentForm property in the RadTaskDialog which gets the current RadTaskDialogForm holding the dialog and you can subscribe for the Shown event , where you set the selected index to -1.
private void CurrentForm_Shown(object sender, EventArgs e)
{
dropdownButton.SelectedIndex = -1;
}
The second approach is to use the SelectedIndexChanging event in the RadDropDownList which fires before SelectedIndex is changed and the event allows the operation to be canceled.
bool isLoading = true;
private void DropdownButton_SelectedIndexChanging(object sender, Telerik.WinControls.UI.Data.PositionChangingCancelEventArgs e)
{
if (isLoading)
{
e.Cancel = true;
isLoading = false;
}
}
Here are the links to the documentation as well, where you can see more information about the events and properties which you can use:
I am sending you the example project as well.
Hope this helps you.
Regards,
Maria
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Thank you - this is exactly what I was looking for.
Hi Bonnie,
The RadTaskDialog control supports different element types that can be added to a RadTaskDialogPage which represents the main container that hosts the elements. It is possible to add different elements like RadDropDownList(ComboBox) to the TaskDialog. I am sending you a sample project, where I have added RadButtonElement and RadDropDownListElement into the RadioButtons collection and a link to the documentation as well.
https://docs.telerik.com/devtools/winforms/controls/task-dialog/task-dialog-element-types
I hope this helps you, if this is not what you want don't hesitate to write again.
Regards,
Maria
Progress Telerik
Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.
Thank you for the sample project. It helped quite a bit.
I have one more question .
The dropdown is bound to a list of objects.
Each time the Task Dialog renders, the first object in the list is always selected.
Is there a way to have no item selected in the drop down (ie, a blank text box that perhaps uses the 'null text' value) when the task dialog renders?