I created a rowedittemplate for a band in my grid and set the rowedittemplate property for that band. In the code, I have the following code for a button click:
Dim newRow As UltraGridRow = gridTransaction.DisplayLayout.Bands(2).AddNew()
gridTransaction.ActiveRow = newRow
The rowedittemplate never appears. Then I tried just clicking on the row selector, in the cells, and anywhere else and it still won't appear. The grid is letting me edit the row directly but I want to use the template. The rowedittemplateuitype for the band is set to onenteredit mode. Any help would be appreciated.
So there are a few things you can try:
Here is what is happening and I'm not sure what to do. I am bound to a dataset at design-time, but at run time, I add a column to a table in the dataset (its an expression type column). As soon as that happens, the rowedittemplate for the band (which by the way is not the band bound to the table where the column was added) gets set to nothing.
Is it JUST the RowEditTemplate which is getting cleared? It sounds like maybe your data source is sending a Reset notification which means the grid will lose everything layout-related, like column widths and positions, etc.
I can't see why adding a column would cause a Reset, though - unless maybe it's a chaptered column.
Why don't you just use the InitializeLayout event to re-assign the RowEditTemplate to the band at run-time?
Oddly enough I create the actual grid column as a placeholder at design time and then create the column for the data table at runtime. No other grid column settings are affected when the datacolumn is added. In order to work around this, I reset the rowedittemplate immediately after I add the datacolumn to the datatable.