Edit on Template Column

R

randy

I have a datagrid with a Edit, Update, Cancel column. I clicked the
"Convert this column into a Template Column" so I can mimic the below
example and put a link button in the footer template area.

http://www.dotnetbips.com/displayarticle.aspx?id=125

The problem is, I need to click "edit" twice for the Edit Template textboxes
to show (or refresh the page). I put my code in the DataGrid1_ItemCommand()
event like so...

If e.commandname.toupper = "EDIT" Then
datagrid.EditItemIndex = e.item.itemindex
End if

If I rebind the datagrid after setting the EditItemIndex property The edit
textboxes come up the first time but they are blank. There IS data in my
source.

If e.commandname.toupper = "EDIT" Then
datagrid.EditItemIndex = e.item.itemindex

datagrid1.datasource = datatable
datagrid1.databind
End if

I want to note that the rest of my columns are template columns so I can
have the "Add New" textboxes just like the example at that website.

Much thanks,

-Randy
 

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

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top