DataGrid DropDownList proble
How do you know what row you're getting changes for? Here's the issue:
- It's a web application
- I have a dropdown list in a column of my datagrid. The datagrid does
- The dropdown list is defined in an ItemTemplate, not an EditItemTemplate.
This is inside a TemplateColumn.
- I databind it to a DataTable. All the data shows up as expected, the
DropDownList is set to the proper value, and has the proper items available
for selection in its list available for selection.
- When the user selects a new value for one of the dropdownlists, the page
is redisplayed (correctly) with the changed value in the dropdownlist
control. In the event handler for the SelectedIndexChanged event I can
determine the SelectedIndex for the newly selected item in the dropdownlist.
So far, so good. (I find it interesting that, although the
SelectedIndexChanged event is the one for the DataGrid, the 'sender' the
event handler receives is the DropDownList object, not the DataGrid object.)
What I can't determine is what row this particular DropDownList belongs
Now, every example I've seen shows edited controls in an
EditItemTemplate instead of an ItemTemplate, and it may be that this is the
source of my problem. But these examples also require a click of an Edit
link to show the EditItemTemplate instead of the ItemTemplate. My goal is
to eliminate the need for this mouse click by just having the DropDownList
show up in the ItemTemplate.
Everything is working except the inability to know which row is being
Does anyone know how to do this, or if it's even possible?
Thanks in advance,
|All times are GMT. The time now is 04:12 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.