User (Old forums)MemberDecember 16, 2003 at 12:33 pmPost count: 23064
I have to admit that I am new with Xceed Grid, but one thing does not look quite logical:
I have a simple data-bound greed with two columns, bound on a dataset. The first column is bound to an autonumber field. The second column is bound to a text field.
I have follwoing code associated with a button for adding new row and editing it immidiately:
// add the row
DataRow newrow = gridControl1.DataRows.AddNew();
//get the index
int ind = newrow.Index;
//select the row
// scroll down
// start editing
I also have another button on the form, with the following code, for updating the dataset:
When I click on a button to add the new row, it really appears as if it does what it should do – adds a new row in the grid, immidiately writes the next autonumber index in the first column and starts editing in the second column.
When I click the other (“save”) button, it really adds a new record in a table, but it is empty, even if I entered something in the grid?!
PS. Sorry for bad english (I’m not a native english speaker)
Imported from legacy forums. Posted by winabike (had 3910 views)User (Old forums)MemberDecember 16, 2003 at 1:00 pmPost count: 23064
Oh, I forgot to say: when I restart the application, and edit the field which was entred as blank before, and click “save button”, it works ok.
It means, editing of the fields works totaly ok, but adding & editing makes troubles (saves blank fields in the table)…
Imported from legacy forums. Posted by winabike (had 274 views)User (Old forums)MemberDecember 17, 2003 at 6:14 amPost count: 23064
It seams that hen you call EnterEdit method, change the value of the cell, and click somewhere else in the grid, the cell still stays in the edit mode?!
If you edit the cell with the doubleclick, everything works ok…
So the solution for the problem is to make some coding in ValueChanged event:
private void celldataRowTemplate1naziv_ValueChanged(object sender, System.EventArgs e)
Xceed.Grid.DataCell sndr = (Xceed.Grid.DataCell)sender;
bool celledited = sndr.IsBeingEdited;
if (celledited==true) sndr.ParentRow.EndEdit();
Hope it helps somebody who comes to the same problem…
Imported from legacy forums. Posted by winabike (had 329 views)
- You must be logged in to reply to this topic.