Multiple Rows per Record

I display 3 Rows per Record in a gridDataBoundGrid. Is it possible to change the height of every first row of these 3 rows to 20 and the height of every second row of these 3 rows to 30?

1 Reply

AD Administrator Syncfusion Team July 24, 2003 08:21 PM UTC

I think you can handle the Model.QueryRowHeght to do what you described. Here is code that worked in the MultiRowRecord sample.
//hook and unhook the event in the toggleMultiRowCheckBox_CheckedChanged handler so the event only fires when the mulitple rows are checked
gridModel.QueryRowHeight += new GridRowColSizeEventHandler(grid_QueryRowHeight); //hooking code

gridModel.QueryRowHeight -= new GridRowColSizeEventHandler(grid_QueryRowHeight); //unhooking code


//the handler
private void grid_QueryRowHeight(object sender, GridRowColSizeEventArgs e)
{
	if(this.toggleMultiRowCheckBox.Checked)
	{
		GridModel gridModel = sender as GridModel;
		if(gridModel != null)
		{
			int row = e.Index - gridModel.Cols.HeaderCount;
			if(row % 3 == 0)
			{
				e.Size = 30;
				e.Handled = true;
			}
			else if(row % 3 == 1)
			{
				e.Size = 20;
				e.Handled = true;
			}
		}
	}
}

Loader.
Up arrow icon