Hi, i use currently infragistics v10 vol3 webdatagrid. i bind it dynamically with an dataset. i have edit mode on to change the value of some cells (but not all! ) now i want some columns prevent for editing (change values) .What is the best way to handle this code behind !i set the columns also code behindilke thisDim Datacolumn2 As New BoundDataField Datacolumn2.DataFieldName = sFieldname.ToLower Datacolumn2.Key = sFieldname.ToLower Datacolumn2.Header.Text = Titel Datacolumn2.Width = nsize webdatagrid1.Columns.Add(Datacolumn2)
in the InitializeRow event i have no property.
Hi thanks for your hints, the following now working for me.
Dim objColumnEdit As New EditingColumnSetting
objColumnEdit.ReadOnly =
True
objColumnEdit.ColumnKey =
"col1"
WebDataGrid2.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(objColumnEdit)
EditingColumnSetting
objColumnEdit1.ReadOnly =
objColumnEdit1.ColumnKey =
"col2"
WebDataGrid2.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(objColumnEdit1)
objColumnEdit2.ReadOnly =
objColumnEdit2.ColumnKey =
"col3"
WebDataGrid2.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(objColumnEdit2)
Hi again,
You could also capture the client side enteringeditmode event and use code behind to assign the event. Here's a snippet from the forums:
function enteringEditMode(grid, eventArgs)
{
var cell = eventArgs.getCell();
if (cell.get_column().get_key() == "SecondColumn")
eventArgs.set_cancel(true);
}
Ed
Hi,
I can get you close, but there's something wrong here:
cs.ColumnKey =
"Key"
WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(cs)
That's where you can set readonly in the markup, but there is no readonly property in cs. It's supposed to be there. I have 10.2, maybe in 10.3 it's there.
Good Luck,