DataGrid problems I need to click twice

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey
I have edit / update / cancel column. And templated column in a template
column there is edittemplate. But I always need to click in Edit twice to
invoke "edit-mode". In OnEdit event I set dgMy.EditItem = e.item.itemindex,
and I checked it's invoked on each click. I also checked ItemCreate invent
after I click Edit it doesn't have EditItem type :( So I got the same
datagrid but after second click it suddenly changes it also has EditItem in
ItemCreate... but UpdateEvent is invoked... To be honest the editEvent is
invoked and updateEvent is invoked. Can you tell me how to fix it ?
Jarod
 
Hi Jarod,

In EditCommand event, you need to assign EditItem and rebind datagrid's data
source:

dgMy.EditItem = e.item.itemindex;
dgMy.DataSource = Data_Object;
dgMy.DataBind();

HTH

Elton Wang
(e-mail address removed)
 
Back
Top