Hi Smit,
Thank you for contacting Syncfusion support.
To hide the header row when records are not loaded in grid, the QueryRowHeight event can be used. In that event, e.Height property can be set to zero to hide the header row. We have created a simple sample to achieve your requirement and please make use of the below code example for further details.
Example code
|
//Event subscription
dataGrid.QueryRowHeight += DataGrid_QueryRowHeight;
//Event customization
private void DataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)
{
if (dataGrid.GetHeaderIndex() == e.RowIndex)
if ((dataGrid.View == null || (dataGrid.View != null && dataGrid.View.Records.Count == 0)))
{
e.Height = 0;
e.Handled = true;
}
else
{
e.Height = dataGrid.HeaderRowHeight;
e.Handled = true;
}
} |
Please get back to us if you have any other queries.
Regards,
Arulpriya Ramalingam