In the sample application that you attached, the code doesn't work as expected because by the time BeginInvoke(...) fires, the CurrentCell is pointing to a new cell and it measures text for that new cell. How do I set my cells to accept returns and not to jump to a new cell (I want to type a large text with new line characters [Enter key] and see the row height adjusted as I type)? If I set the cell's value programatically (this.dgMain.Model[1, 1].CellValue = "Customer Safety"), what event can I catch to readjust the row height?
grid.Model.QueryCellInfo += Model_QueryCellInfo;
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.Style.RowIndex == 1 && e.Style.ColumnIndex == 1)
ResizeRowHeights(grid, GridRangeInfo.Cell(e.Style.RowIndex, e.Style.ColumnIndex));
}
|