Here is a RowsInserting event handler that shows how you can populate the cells to be inserted.
private void grid_RowsInserting(object sender, GridRangeInsertingEventArgs e)
{
GridStyleInfoStoreTable data = new GridStyleInfoStoreTable(e.Count, this.gridControl1.ColCount + 1);
for(int row = 0; row 0)
style.BackColor = Color.LightGoldenrodYellow;
data[row,col] = style.Store;
}
}
e.InsertRangeOptions.Data = data;
}
A comment. The col loop starts at -1. The -1 entry is the style that is used to populate the RowStyle style object.
As far as setting some cells (slave cells) to be dropdowngrids based on the value of another cell(master cell), there are two basic approaches.
One is to deterministically set the slave cells by monitoring every time the master cell changes. You can do this in CurrentCellChanged for a checkbox cell. For other cells like a TextBox cells, you might use CurrentCellValidating or CurrentCellAcceptedChanges.
The other technique is to dynamically set up the slave cells in QueryCellInfo. This event is fired whenever the grid needs a particular cell. In it, you can check e.RowIndex and e.ColIndex, and then set e.Style for this requested cell to provide the cell type. In this event, you could check the value of the master cell, and then dynamically provide the celltype based on the master cell value.
I do not know one technique is beeter than another in general. If you data is dynamic, and you are already using QueryCellInfo to manage teh dynamica data, then the QueryCellInfo would be simpler in this case.