I am trying to insert a invisible column into a UltraWebGrid that includeds a checkbox. The purpose of the checkbox is to give each row a boolean value true if the row has a cell or cell's that have been edited and false if not. Then have it loop through to pick up all rows that are true and update it back to the database. I can't seem to find how to add a checkbox to the grid. Open to all ideas, but prefer in Visual Basic do to the fact that is what I am working with.
Thanks in Advance
You can likely already get this from the grid already, by using its UpdateRow or UpdateRowBatch events. These events are raised once for each row that was modified. The difference between the events is that handling UpdateRow causes a postback to trigger when a row is modified, once that row or the grid loses focus, while UpdateRowBatch adds up all edits until something else triggers a postback.
If you want to add a column to the grid to track this yourself anyway, you likely want to use an unbound boolean column. Set the value of that cell to "true" to simulate a checked checkbox. Consider the following VB.NET code added to the InitializeLayout event of the grid:
Imports Infragistics.WebUI.UltraWebGrid...Private Sub UltraWebGrid1_InitializeLayout(ByVal sender as Object, ByVal e as LayoutEventArgs) Handles UltraWebGrid1.InitializeLayout ' Create a new column - be sure that it's saved in ViewState Dim col as New UltraGridColumn(True) ' Set the column's Key so that you can refer to it again more easily col.Key = "HiddenBoolean" ' Make the column a boolean column col.DataType = GetType(System.Boolean).ToString() ' Hide the column col.Hidden = true ' Add the column to the root band of the grid e.Layout.Bands(0).Columns.Add(col)End Sub