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

load on request

3 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 10 Nov 2008, 03:40 PM
I have a grid with 2 Radcombo's in it.  When a user makes a selection in the first drop down, I need to filter the values available in the second drop down based on the selection in the first drop down.  Are there any example projects that I can take a look at to give me some pointers ?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Nov 2008, 04:38 AM
Hello Mark,

Go through the following online demo which explains on how to populate a combobox on the SelectedIndexChanged event of another combobox when the grid is in EditMode. You can probably make modifications to the code and use it  according to your requirement.
Accessing cells and rows

Thanks
Princy.
0
mww
Top achievements
Rank 1
answered on 12 Nov 2008, 12:43 PM
Ive followed the example and have got the basic functionlity to work ok.  There is a problem though.
setting the autopostback property to true clears all precededing rows of data ! (but only the column the drop down is in)

protected void RadGridArtistGenres_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
            {  
                //the dropdown list will be the first control in the Controls collection of the corresponding cell  
                RadComboBox list = (e.Item as GridEditableItem)["ddlArtistType"].Controls[0] as RadComboBox;  
 
                //attach SelectedIndexChanged event for the combobox control  
                list.AutoPostBack = true;  
                list.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list_SelectedIndexChanged);  
            }  
 
        } 

Disabling these 2 lines keeps the row in but obviously removes the desrired functioality
list.AutoPostBack = true;  
list.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list_SelectedIndexChanged);

I have sceenshots of the result but cant see a way to post these on the forum
0
mww
Top achievements
Rank 1
answered on 12 Nov 2008, 01:22 PM
Its actually not just the preceeding rows, but all the rows that are being cleared (but again only the column the dropdown is in)
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
mww
Top achievements
Rank 1
Share this question
or