Hi,
I have a RadGrid which is bound to a LinqDataSource. In the where parameter of the datasource I have a ControlParameter which references a RadComboBox. With this setup the content of the grid changes when the selection of the combo box changes. So far so good. The problem is, that on page load the combobox is bound to its datasource and displays its contents but the grid does not. The grid is updated when I firs change the selection of the combo box.
How can I fill the grid proprtly on page load?
Best regards,
Robert
5 Answers, 1 is accepted
0
Hello Robert,
You can set DefaultValue for this ControlParameter to achieve your goal.
Regards,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You can set DefaultValue for this ControlParameter to achieve your goal.
Regards,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 15 Dec 2008, 05:13 PM
Hi Vlad,
thank your for your reply. What could be a useful value for the "DefaultValue" property? The problem is, that the default value depends on the combo box's data items. I cannot hardcode this value since the data which the combobox is bound to can change and then the "DefaultValue" property would also have to change.
Best regards,
Robert
0
Hello Robert,
I've attached small example.
Let me know if you have any questions.
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I've attached small example.
Let me know if you have any questions.
Greetings,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 16 Dec 2008, 08:58 AM
Hi Vlad,
thank you for that example project. It helped me to resolve the problem. The error was caused by the "Filter" property of the combo box which was set to "Contains". After removing this property it worked well. Now, I set the "Filter" property in codebehind after databinding the combo box which works as expected. Do you have an idea, why the Filter did prevent the combo box from selecting it's first item?
0
Hello Robert,
Indeed the inconsistency is observable in the project posted by Vlad.
We will look further into it and in the meanwhile I suggest you use the following workaround: handle the OnDataBound event of the ComboBox and select its first Item (or another based on some business logic).
Regards,
Simon
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Indeed the inconsistency is observable in the project posted by Vlad.
We will look further into it and in the meanwhile I suggest you use the following workaround: handle the OnDataBound event of the ComboBox and select its first Item (or another based on some business logic).
Regards,
Simon
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.