By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

Data Grid Events

P: n/a
When the user presses the "Edit" link on the data grid, one of the fields is
a drop down list. I need to build this list at run time and I was using the
"DataBound" envent to populate the items in the dropdown.

The problem is that when the user makes a selection from the dropdown box,
it goes back through the DataBound event and rebuild the drop down,
effectively loosing the value for the selected index. I have tried the
"ItemCreated" event, but the same thing happens.

How do you load a drop down control for a control which is in the "EditItem"
Template, but still retain the selected index value when the user has pressed
the "Update" linked button when in the "edit mode" of the datagrid.

Thansk in advance for your assistance!
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try adding a check whether the request is a postback or not. You should
avoid rebinding the data on each postback.

Nov 19 '05 #2

P: n/a
You have to have a post back to get into edit mode...so checking for
postback will ensure that I do not load the items into my control....

So this will not work.
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.