DataGrid save editing rows

  • Thread starter Thread starter Islamegy
  • Start date Start date
I

Islamegy

When i press btn_save all changed rows in my grid get saved except the last
editing row...

I want my btn_Save to end editing in the datagrid.. so if user didn't press
"enter" after editing last cell of the current row, I could force this row
to be saved in the datasource.

help plz
 
Hi Islameguy,

I think if you call DataGrid.EndEdit in your button event and speficy false for shouldAbort the changes are saved.
 
i tried it and didn't work with shouldAbort =false or true...

dataGrid2.EndEdit(dataGrid2.TableStyles[0].GridColumnStyles[dataGrid2.Curren
tCell.ColumnNumber],dataGrid2.CurrentRowIndex,false);

have any other ideas??


Morten Wennevik said:
Hi Islameguy,

I think if you call DataGrid.EndEdit in your button event and speficy
false for shouldAbort the changes are saved.
 
Not sure what the problem might be. I created a simple datagrid sample using a database as source and updating using SqlDataAdapter.Update(DataSet). Any DataGrid cell being edited is saved when the Update button is pressed. I used VS.Net 2003 and MSDE, with an autoconfigured SqlDataAdapter.

Could you give us a code sample demonstrating the problem? How do you update the data? How do you display/edit the data? What kind of datasource do you use?


i tried it and didn't work with shouldAbort =false or true...

dataGrid2.EndEdit(dataGrid2.TableStyles[0].GridColumnStyles[dataGrid2.Curren
tCell.ColumnNumber],dataGrid2.CurrentRowIndex,false);

have any other ideas??


Morten Wennevik said:
Hi Islameguy,

I think if you call DataGrid.EndEdit in your button event and speficy
false for shouldAbort the changes are saved.
 
Back
Top