We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DataGridControl - change Row Height inside a nested Grid

Hi,

To be able to control the Row Height within a DataGrid, I know you have to either setup a dependency property for XAML to use or use code behind but you do not seem to be able to do this for any nested Grids (relations)?, basically you cannot do something like this:

foreach (var Relation in this.uxAssembliesDataGrid.Relations)

{

Relation.TableProperties.RowHeights.DefaultLineSize = 30d;

}

Any suggestions?

Regards

Kevin

 


1 Reply

DA Divya A Syncfusion Team August 1, 2013 10:58 AM UTC

Hi Kevin,

 

We can set the DefaultLineSize for the nested grid in the RecordExpanded event. Here, we can get the Model of each nested Child and can set the row height through DefaultLineSize API as in the following code snippet.

 

 

Code Snippet:

 

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

        

        void dataGrid_ModelLoaded(object sender, EventArgs e)

        {

            this.dataGrid.Model.Table.RecordExpanded+=new EventHandler<GridDataValueEventArgs<GridDataRecord>>(Table_RecordExpanded);

        }

 

        void Table_RecordExpanded(object sender, GridDataValueEventArgs<GridDataRecord> e)

        {

            e.Value.ChildModels[0].RowHeights.DefaultLineSize = 30d;

        }

 

 

Regards,

Divya.



Loader.
Live Chat Icon For mobile
Up arrow icon