I have created an UltraWinGrid which is binding to a datasource that holds a data table.I manually add columns to the Grid. (Ex. grid.DisplayLayout.Bands[0].Column[1]) and manually setting the property of all the columns in the grid.
I'm trying to add new row to the Grid and it succeeds only if I call immediately the save database command.
But, if I try to click any other row besides the "new row" the grid clears away all the details added to the new row.
How can I keep the focus to the new row till I save it? What are my options?
Hi Krish,
I can't see what RowUpdateCancelAction could possibly have to do with this. It sounds to me like you are under a basic misconeption about the grid.
You say you are creating all of the columns in the grid yourself? How are you doing that? Are you doing this at design-time? Are you binding the grid to a data source after that?
The grid MUST be bound to a data source, it cannot be used unbound. So it sounds to me like you are trying to use it without a data source and that's why the data is just disappearing, because there is nothing to store it. If you want to use the grid without a database, then I recommend you using an UltraDataSource or perhaps a generic BindingList<> as your data source.
Thanks Arun.
I will try this out.
Thanks,
Krish.
hi krish,
In Grid set ,
RowUpdateCancelAction = RetainDataAndActivation
and try playing with the BeforecellDeactivate event to check if it is a New AddRow and then validate it of force the user to keep him focused in the current cell
take care of the Update Mode - preferably to be on CellChangeot lostfocus
hope helps you out,
hppy Koding,
Arun