2 datagrids on the same page, can we toggle edit mode??

J

J. Bannon

I have 2 datagrids on the same page, I would like to only allow users to put
one at a time in editmode. Currently, I can put them both in editmode.


If I have DataGrid1 already in edit mode, and I choose to edit DataGrid2, I
tried the following, which did not work (actually it doesn't seem to do
anything to DataGrid1):


Sub DataGrid2_Edit(sender as Object, e as DataListCommandEventArgs)

dgDataGrid1.EditItemIndex = -1 'turn off edit for DataGrid1

dgDataGrid2.EditItemIndex = e.Item.ItemIndex 'turn on edit for DataGrid2

BindData()

End Sub

I also tried calling the Cancel event for the DataGrid1 but that gave me
errors.

Any suggestions?? I'm sure there is an easy way to do it, but I can't see
it.

Thanks
 
J

Jim Cheshire [MSFT]

Hi J.,

I'll give this a run through as soon as I get a chance and let you know
what I find.

Jim Cheshire [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top