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

RadGrid with Radcombo Edit Template

2 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vairam
Top achievements
Rank 1
vairam asked on 03 Mar 2010, 09:04 AM
Hi

I am using The RadGrid to add,edit,Delete the Employee detail (In line Edit mode).
I have two drop down column Country,State.
In Edit or ADD mode
When i selected the Country depends on the Country selected  i need to populate the State Drop down.
How can i achieve this.Which Event I need to handle.


Regards
Vairamtuhu

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Mar 2010, 09:44 AM
Hi Vairamtuhu,

Get the selected country in SelectedIndexChanged event of country combo and query the db to get the states and then set the DataSource for the State combobox. Here is the example of how to achieve this.

C#:
 
    protected void CountryCombo_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
    { 
        RadComboBox countryCombo = (RadComboBox)o; 
        GridEditableItem editItem = (GridEditableItem) countryCombo.NamingContainer; 
        string countrySelected = countryCombo.SelectedValue; // The selected country 
 
        RadComboBox stateCombo = (RadComboBox) editItem.FindControl("StateCombo"); 
        // Now populate the stateCombo according to countrySelected value 
    } 

All the best,
Shinu.
0
vairam
Top achievements
Rank 1
answered on 03 Mar 2010, 01:09 PM
hi Shinu

        Thanks for your reply.
My problem got fixed

Regards
Vairamtuhu
Tags
Grid
Asked by
vairam
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
vairam
Top achievements
Rank 1
Share this question
or