GridDataControl + Wpf

Hi I have a grid connected to a collection when the collection has no element of the grid does not display the column headers, also shows the row for data entry

Thanks for the help



1 Reply

MA Manikandan Syncfusion Team May 4, 2011 12:19 PM UTC

Hi Jose,

Thank you for using Syncfusion products.

We have checked with your requirement and found that you are trying to hide the Column Headers and AddNewRow row when the collection is empty. You can achieve your requirement by setting the Header Row height to zero and ShowAddNewRow to false as shown in the following code snippet :

Code Snippet[C#]

this.dataGrid.ShowAddNewRow = false;

this.dataGrid.ModelLoaded += new EventHandler(dataGrid_ModelLoaded);

void dataGrid_ModelLoaded(object sender, EventArgs e)
{
if (collec.Count == 0)
{
//hiding the column headers
this.dataGrid.Model.RowHeights[0] = 0d;
}
}

Regards,
Manikandan



Loader.
Up arrow icon