PDA

Click to See Complete Forum and Search --> : drop down in datagrid


fmardani
Dec 10th, 2004, 11:30 AM
Hi,
There is a drop down box in a web datagrid.
This drop down is populated by using datatextfield and datavaluefied.
Iin the edit mode of the grid I change the item in the drop down.
How can I get the NEW integer value of the drop down?
This is required for the update.

Thanks

Danial
Dec 10th, 2004, 05:54 PM
Lets assume your drop down is named "cmbMake", here is how you can get the selected value.

DropDownList cmb = new DropDownList();
int MakeID;

cmb = (DropDownList)e.Item.FindControl("cmbMake");
MakeID = Convert.ToInt32(cmb.Items[cmb.SelectedIndex].Value);