Hi Rick,
You can resize the columns and rows to fit over the grid's entire area, by handling the Grid.Model.QueryColWidth and Grid.Model.QueryRowHeight respectively. Below are the code snippets that helps in doing this.
private void Model_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if(e.Index > this.gridDataBoundGrid1.Model.Cols.HeaderCount)
{
int clientwidth = this.gridDataBoundGrid1.ClientRectangle.Width - this.gridDataBoundGrid1.Model.ColWidths[0];
e.Size = (int)(clientwidth / (float)this.gridDataBoundGrid1.Model.ColCount);
e.Handled = true;
}
}
private void Model_QueryRowHeight(object sender, GridRowColSizeEventArgs e)
{
if(e.Index > this.gridDataBoundGrid1.Model.Cols.HeaderCount)
{
int clientheight = this.gridDataBoundGrid1.ClientRectangle.Height - this.gridDataBoundGrid1.Model.RowHeights[0];
e.Size = (int) ( clientheight / (float) this.gridDataBoundGrid1.Model.RowCount );
e.Handled = true;
}
}
Regards,
Rajagopal