Task Dialog - Is it possible to add a Combo Box or a MultiColumnComboBox to a Task Dialog?

2 Answers 160 Views
Form
Bonnie
Top achievements
Rank 1
Bonnie asked on 02 Sep 2022, 06:23 PM

Is it possible to add a Combo Box or a MultiColumnComboBox to a Task Dialog?

If so, how would I do that?

2 Answers, 1 is accepted

Sort by
0
Accepted
Maria
Telerik team
answered on 09 Sep 2022, 11:09 AM

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:

https://docs.telerik.com/devtools/winforms/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/properties-methods-events

https://docs.telerik.com/devtools/winforms/controls/task-dialog/task-dialog-properties-methods-events

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.

Bonnie
Top achievements
Rank 1
commented on 12 Sep 2022, 02:42 PM

Thank you - this is exactly what I was looking for.

 

0
Maria
Telerik team
answered on 05 Sep 2022, 12:18 PM

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

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Bonnie
Top achievements
Rank 1
commented on 08 Sep 2022, 02:08 PM

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?

Tags
Form
Asked by
Bonnie
Top achievements
Rank 1
Answers by
Maria
Telerik team
Share this question
or