Data Binding and Edit/Update/Cancel Chicken-and-Egg Problem

D

dcouture

Would you be able to help me out on this one? I've got a DataGrid
control that I create dynamically - no problem there. I also add a
hyperlink column - again no problem. Now I'm adding the
Edit/Update/Cancel column - Problem! The issue is that since the user
may have done editing, I don't want to do a DataBind() when I'm
reloading the page. However, I seem to need to do the DataBind() to get
the hyperlink and Edit/Update/Cancel columns to redisplay. The only
site that I found that had an answer to this question... required
payment! Ugh! Any help you can give me would be greatly appreciated.
Thanks.
 
E

Elton Wang

Hi Dcouture,

You can try following logic:

if (postback){
if (datagrid.EditItemIndex > -1){
// get Edit Item
item = datagrid.Items(datagrid.EditItemIndex);
// process data in the item
}
}
DataBind()

HTH

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top