datagrid in vb.net ( not asp.net )

J

James Lang

OK all you clever people

I have a datagrid in vb.net that is bound to an arraylist
I have created a DataGridTableStyle and added the columns I want to show and
all works well

Now for the sticky bit
If I edit a cell and tab or click to the next cell then the edit is OK
the underlying data is updated
BUT
if I edit a cell and then click on another control say a commandbutton then
the datagrid is left in edit
mode ie the pencil icon is present on the left of the row I just changed
and the underlying data is not updated.

Any help on how to fix this would be a great help !!!!!!!!!!

ps dont say use a datatable or dataset and choose a table from it
That I can do. Its the Arraylist that I want to work with in this situation

Thanks in advance
James
 
J

Josh Moody [MSFT]

This is just a guess, but you probably want to do something like this:

Private Sub DataGrid1_Leave(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Leave
DataGrid1.EndEdit(DataGrid1.TableStyles(0).GridColumnStyles(0),
DataGrid1.CurrentRowIndex, False)
End Sub

HTH (hope that works too :) )

Josh Moody
Developer Division Sustained Engineering Team

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
 
R

Ravichandran J.V.

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

Top