This is a migrated thread and some comments may be shown as answers.

Controlling column width of child column when using grid view with hierarchical data

1 Answer 171 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Murali
Top achievements
Rank 1
Murali asked on 06 Jul 2017, 07:51 AM
I am using the telerik Gridview control to display hierarchial data. Wrote the program as per details provided at 
http://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/how-to/access-child-gridview
(used ChildTableDefinitions & HierarchyChildTemplate)

The data displayed in the grid is as follows -

Parent columns -
* Parent Name
* Current Status

Child columns -
* Timestamp
* Status

Requirement -
Parent Grid's last column ("Current Status") width is set to * so that it can take the full available width of the page.
When we click on the "+" sign near the parent, the child grid view gets expanded.
In the child grid view, the last column ("Status") width  should be equal to last column ("Current Status") width of the parent.
Currently the column width of the last column ("Current Status") is set to *.


Observed behavior -
The child grid view's last column ("Status") width is set to a large value more than the laset column width of the parent.
Due to this large width, a scroll bar gets added at the bottom to scroll to the end.
Note that the data in the last column ("Status") of child grid is very less, so no idea why its creating the column width of such large value.
Please check attached file "child_grid_expanded_with_comments.png".

Can you please let me know how to solve this problem.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Jul 2017, 06:46 AM
Hello Murali,

Thank you for the provided image.

I tested the hierarchy mechanism of the control locally and was not able to replicate such behavior. Can you please take a look at the attached sample application I used for testing? In what manner does it differ from the setup you are using?

Regards,
Stefan X1
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Marcel
Top achievements
Rank 1
commented on 20 Nov 2023, 12:14 PM

I am facing the same issue. Could you resolve it and show me what you did?
Martin Ivanov
Telerik team
commented on 21 Nov 2023, 09:02 AM

Can you share some code showing your setup?
Tags
GridView
Asked by
Murali
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or