This is a migrated thread and some comments may be shown as answers.

Data Binding Selected Value

5 Answers 234 Views
MultiColumnComboBox
This is a migrated thread and some comments may be shown as answers.
Wally
Top achievements
Rank 1
Wally asked on 10 Mar 2020, 03:53 PM
If I have a MultiColumnComboBox in a RadDataForm, how do I data bind the Selected Value to the datasource of the RadDataForm?

5 Answers, 1 is accepted

Sort by
0
Accepted
Doncho
Telerik team
answered on 13 Mar 2020, 01:09 PM

Hello Wally,

To populate the selected value of RadMultiColumnComboBox in the RadDataForm you need to bind it using the Value property. The parameter passed in the binding function should be an existing field of the RadDataForm's data source. The two properties DataTextField and DataValueField are pointing to the respective fields of the data source bound to the RadMultiColumnComboBox.

<telerik:RadMultiColumnComboBox runat="server" ID="RadMultiColumnComboBox1"
    OnDataBinding="RadMultiColumnComboBox1_DataBinding" 
    DataTextField ="ShipName"
    DataValueField="ShipName"
    Value='<%# Bind("ShipName") %>'>
</telerik:RadMultiColumnComboBox>

You can also take look at the  DataForm - Manual CRUD Operations demo and follow the approach used in the demo for binding other controls to the RadDataForm's data source.

I hope that will prove helpful.

Kind regards,
Doncho
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Wally
Top achievements
Rank 1
answered on 13 Mar 2020, 01:26 PM
Thank you, I didn't realize there would be a hidden parameter.  However, that tutorial doesn't cover how to databind a MultiColumnComboBox to a parent Data Form.
0
Doncho
Telerik team
answered on 18 Mar 2020, 09:42 AM

Hello Wally,

This is a well-known method to bind values to Controls inside the Template of another Control. The only difference is, that Telerik controls require the Bind() instead of Eval() when editing items and using that control as the editing control.

Check out the Introduction to ASP.NET inline expressions in the .NET Framework article to find out more about the server expressions.

Kind Regards,
Doncho
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Wally
Top achievements
Rank 1
answered on 18 Mar 2020, 12:56 PM
Yeah, the "Bind()" statement wasn't the confusing part, the "Value" parameter was.  That doesn't show up in the autocomplete when looking for parameters for the RadMultiColumnComboBox.
0
Doncho
Telerik team
answered on 23 Mar 2020, 08:56 AM

Hello Wally,

Whether it's the SelectedValue, SelectedText, Value or Text, it depends which is available for that specific control. However, the reason behind the property not popping up in IntellIsesne is the default behavior of the ASP.NET Framework. Since Telerik uses the standard ASP.NET Framework, the same behavior would be present. 

Nevertheless, we have created a Knowledgebase article that explains more about this, see Selected Values of Controls when used in Templates.

Kind regards,
Doncho
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
MultiColumnComboBox
Asked by
Wally
Top achievements
Rank 1
Answers by
Doncho
Telerik team
Wally
Top achievements
Rank 1
Share this question
or