In this post I will show you how you can use the DropDownList SelectedIndexChanged, when DropDownList is placed inside the grid view control. The main form consist of grid view control. The grid view control consist of order name, current status label which will be update when use select one of the value from the dropdownList control in the grid view control.
Here is the html code which is used to bind the SelectedIndexChanged of the dropdownList with the code behind event handler. And also notice that Autopost back property of the DropDownList is set to true. The DropDownList control is bind to the data source on the grdvCategoryList_RowDataBound event of the grid view control.
And Here is the code which is placed in the selectedIndexChanged of the dropDownList control. You can see in this code that fist I have converted the sender to the dropDownList control and then by using that DropwDownList control I have get the row of the grid where the current grid view control is placed. Now You have found the row of the DropDownList control no you can find the other control in that row. Here I have find the label control which will display the current value from the DropDownList.
You can download the source code from here
All and any comments / bugs / suggestions are welcomed!