|
this.sfDataGrid.QueryRowHeight += sfDataGrid_QueryRowHeight;
void sfDataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
{
if (this.sfDataGrid.View.TopLevelGroup != null )
{
if (IsDefauldRow(e.RowIndex))
{
e.Handled = true;
e.Height = 50;
}
}
else if (!(this.sfDataGrid.TableControl.IsTableSummaryIndex(e.RowIndex) ||
this.sfDataGrid.IsAddNewRowIndex(e.RowIndex) ||
this.sfDataGrid.IsFilterRowIndex(e.RowIndex) ||
this.sfDataGrid.TableControl.GetHeaderIndex() == e.RowIndex))
{
e.Handled = true;
e.Height = 50;
}
}
bool IsDefauldRow(int rowIndex)
{
var startIndex = this.sfDataGrid.TableControl.ResolveStartIndexBasedOnPosition();
var record = this.sfDataGrid.View.TopLevelGroup.DisplayElements[rowIndex - startIndex];
return record != null && record is RecordEntry;
} |