We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Update a value in datagrid and hit the Save button

Hi I have a datagrid with datasource set to a datatable. When I start editing a value (pen symbol on row marker) and hits the Save button without moving of the row first I get that the value is unchanged on the datarow. It works fine if I move of the row first. I'm trying to force the underlying datatable to end editing before doing anything further by using Me.BindingContext(dsClassRooms.ClassRooms).EndCurrentEdit() But it doesent help. Any suggestions ??

1 Reply

JK Juergen Kaufmann July 7, 2003 07:50 AM

> Hi I had the same Problen and did this: if (dgSpesen.CurrentCell.IsEditing) { dgSpesen.CurrentCell.EndEdit(); dgSpesen.CurrentCell.Move(GridDirectionType.Down,1,false); dgSpesen.CurrentCell.Move(GridDirectionType.Up,1,false); dgSpesen.CurrentCell.CancelEdit(); } It works but there may be a better way to do it right. Try it. > Hi > I have a datagrid with datasource set to a datatable. > When I start editing a value (pen symbol on row marker) and hits the Save button without moving of the row first I get that the value is unchanged on the datarow. > It works fine if I move of the row first. > > I'm trying to force the underlying datatable to end editing before doing anything further by using > > Me.BindingContext(dsClassRooms.ClassRooms).EndCurrentEdit() > > But it doesent help. > Any suggestions ?? >

Loader.
Live Chat Icon For mobile
Up arrow icon