doe anyone know how to trigger an event when a user enters data in a cell in a data grid. is it possible to disable columns (make readonly) and allow only certain columns to be edited. I also need to know how to clear a datagrid.
thanks,
jeff
Printable View
doe anyone know how to trigger an event when a user enters data in a cell in a data grid. is it possible to disable columns (make readonly) and allow only certain columns to be edited. I also need to know how to clear a datagrid.
thanks,
jeff
To set columns to readonly, you can create a new DataGridTableStyle and then add a DataGridColumn to the DataGridTableStyle to the new DatagridTableSyle. You can then manipulate the columns styles.
Something similar to this:
Private sub FormatDataGrid
dim gs as theDataGridTableStyle as new DataGridTableStyle
dim column as DataGridTextBoxColumn = new DataGridTextBoxColumn()
column.mappingName = "Name"
column.HeaderText = "Column One"
column.Width = 50
column.readonly = true
column.GridColumnStyles.Add(column)
datagrid1.tablestyles.add(gs)
End Sub
Hope this helps