Home Forums WinForms controls Xceed Grid for WinForms CellEditor and CellViewer Heights Reply To: CellEditor and CellViewer Heights

User (Old forums)
Member
Post count: 23064

Well,

I figured it out. I kept going with the line of thinking i was on, and tried this.

private void dataRowTemplate2_BeginningEdit(object sender, System.ComponentModel.CancelEventArgs e)
{
// Get the DataRow that spawned the event.
Xceed.Grid.DataRow oRow = (Xceed.Grid.DataRow)sender;
// Set a private class variable to the current height of the row. We can use it to reset the height in the EndingEdit event.
this.nRowHeight = oRow.Height;
// 28 is the height of the control i want to use as an Editor
oRow.Height = 28;
}

private void dataRowTemplate2_EndingEdit(object sender, System.ComponentModel.CancelEventArgs e)
{
// Get the DataRow that spawned the event.
Xceed.Grid.DataRow oRow = (Xceed.Grid.DataRow)sender;
// reset the height using the nRowHeight variable set in the BeginningEdit Method
oRow.Height = this.nRowHeight;
}

Which seems to work well. Looks quite pretty actually 🙂

Tommy, thanks for your help!

Regards

Ben

Imported from legacy forums. Posted by apollo (had 3781 views)