Home Forums WinForms controls Xceed Grid for WinForms getfittedwidth-method for unbound detailgrids Reply To: getfittedwidth-method for unbound detailgrids

User (Old forums)
Member
Post count: 23064

You call the GetFittedWidth on the template, before it is filled with actual data, which explains the result you get. So the template is set to the header width, since this is the only thing that is present, and this is the width that is used when generating the actual DetailGrids from the template.

You need to do this once the DetailGrid is actually created and filled with data. In the code I provided before, you can see that a specific DetailGrid instance is taken from a specific row, and this works fine.

i.e.:

//get the DetailGrid
DetailGrid detail = row.DetailGrids[ 0 ];

Imported from legacy forums. Posted by André (had 5473 views)