Ok, telerik riddle me this,
I've built a grid where when in insertiing/updating mode I have two cascading drop downs, the first of which I'm adding the selected index change event when the item is being created. I got everything working splendidly, even the Ajax was working on it and it was beautiful. Then I added GridDropDownListColumnEditors to the grid columns so when in edit mode they'd look all pretty but by doing so that stopped the cascading when in inserting/editing mode. Now why in the world would that have an effect on the behavoir of the control because it shouldn't. Isn't that like one of the first rules about programming, style changes should not have any effect on functionality?
My assumtion is that if you use the GridDropDownListColumnEditors, then in my selected index change event i need to have my column editors also rebind along with the drop down columns?? Or do i need to declare in my rad ajax manager that the editor columns can update the other or vice versa? Currently the only thing the rad ajax manager has declared is that the grid can control itself.
The following code is the selected change event that makes the cascading work.
I've built a grid where when in insertiing/updating mode I have two cascading drop downs, the first of which I'm adding the selected index change event when the item is being created. I got everything working splendidly, even the Ajax was working on it and it was beautiful. Then I added GridDropDownListColumnEditors to the grid columns so when in edit mode they'd look all pretty but by doing so that stopped the cascading when in inserting/editing mode. Now why in the world would that have an effect on the behavoir of the control because it shouldn't. Isn't that like one of the first rules about programming, style changes should not have any effect on functionality?
My assumtion is that if you use the GridDropDownListColumnEditors, then in my selected index change event i need to have my column editors also rebind along with the drop down columns?? Or do i need to declare in my rad ajax manager that the editor columns can update the other or vice versa? Currently the only thing the rad ajax manager has declared is that the grid can control itself.
The following code is the selected change event that makes the cascading work.
protected void Category_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) | |
{ | |
//First reference the edited grid item through the NamingContainer attribute | |
GridEditableItem editedItem = (sender as RadComboBox).NamingContainer as GridEditableItem; | |
//The dropdown list will be the first control in the Controls collection of the corresponding cell | |
RadComboBox ddlist = editedItem["ParentCategory"].Controls[0] as RadComboBox; | |
//Change the data source of the sub-categories dropdown list | |
sdsSubCategories.SelectParameters.Clear(); | |
sdsSubCategories.SelectParameters.Add("ParentCategoryId", ddlist.SelectedValue); | |
sdsSubCategories.DataBind(); | |
//Change the combox's datasource to the sub categories datasource | |
RadComboBox ddlistSub = editedItem["SubCategory"].Controls[0] as RadComboBox; | |
ddlistSub.DataSource = Schools.SubCategoryList(Convert.ToInt32(ddlist.SelectedValue)); | |
ddlistSub.DataBind(); | |
} |