Hello Mike
I hope this code will help you
public void getSelectedValue()
{
DropDownList dd ;
for(int i = 0; i < dGrid.Items.Count ; i++)
{
dd = new DropDownList();
dd= ((DropDownList)dGrid.Items[i].FindControl("ddlTrackingBy"));
string b = dGrid.Items[i].Cells[2].Text;
for(int j = 0 ; j <dd.Items.Count ; j++)
{
if(dd.Items[j].Text == b)
{
dd.SelectedIndex = j;
}
}
}
}
using htis code u could easily get selected index or value
"Mike" wrote:
I have a dropdownlistbox in a template column of a datagrid. I need to be able to respond to the selecteditemchanged event of the dropdownlist, but I am having trouble doing that. I thought I would be able to use the OnItemCommand event, but that doesn't seem to work. Can someone please point me in the right direction if this can be done?