Home Forums WinForms controls Xceed Grid for WinForms Triggering SiblingValueChanged Reply To: Triggering SiblingValueChanged

Xceed Support
Member
Post count: 5658

You can could simply loop through the Cells of the DataRowTemplate to set most of the cells and them modify the exceptions.

Here is a rough example of what I had in mind:

e.g.,
<code>
private void Form1_Load( object sender, EventArgs e )
{
for( int j = 0; j < 6; j++ )
{
Column col = new Column( “Column”+j.ToString() );
gridControl1.Columns.Add( col );
}

for( int i = 0; i < 50; i++ )
{
Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();
foreach( Cell cell in row.Cells )
{
cell.Value = “Item ” + i.ToString();
}
row.EndEdit();
}
}

//The event from the “lock” checkbox
private void checkLock_CheckedChanged( object sender, EventArgs e )
{
if( checkLock.Checked )
{
foreach( Cell cell in dataRowTemplate1.Cells )
{
cell.ReadOnly = true;
}
//Handle the exceptions here
}
else
{
foreach( Cell cell in dataRowTemplate1.Cells )
{
cell.ReadOnly = false;
}
//Handle the exceptions here
}
}
</code>

Imported from legacy forums. Posted by CharlesB (had 205 views)