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

RadGridView hierarchy

5 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Manh
Top achievements
Rank 1
Manh asked on 15 Nov 2012, 08:29 AM
Hi supporters,


I have issue as followings:

I use RadGridView hierarchy first look.
Parent template has columns: A1, A2, A3, A4, A5
And child template has columns: B1, B2, B3, B4, B5, B6, B7

So i want that when i expanse a parent row then some columns in child template be visible and some columns be hide with different parent row.
Example:
- When i expanse Parent row 1, if child rows has columns B5 and B6 is null or zero value then hide B5, B6
- When i expanse Parent row 2, if child rows has columns B7 is null or zero value then hide B7 (B1, B2, B3, B4, B5, B6 are visible)

Could you please help me!

Thanks,

Manh



5 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 15 Nov 2012, 09:04 AM
Hello Manh,

There is just one issue with this, the fact that you have to see the master grid as one grid and the child template as another grid.

To clarify this, if you remove one column from the child grid, you will be (hiding) that column for all child grids, you cannot control the child grid individually for different parent rows.
I hope you understand what i mean.

If you have any other questions, please let me know.


Best Regards,
Emanuel Varga
WinForms MVP
0
Manh
Top achievements
Rank 1
answered on 15 Nov 2012, 10:15 AM
Hi,

ok, i understood your mean. But do you have another way to solve my issue?


Thanks,

Manh
0
Emanuel Varga
Top achievements
Rank 1
answered on 15 Nov 2012, 10:19 AM
Hello again Manh,

If you really need this, i can see two different approaches, first and the simplest one, you allow the user yo have only one expanded child at a time, then this won't be an issue (so that would mean that you will always collapse other expanded rows when the user is expanding another row).

Like this you can take the expanded row iterate trough the rows and hide / show columns based on the child data.

Or you could use a second grid, and display in the second grid the child data, this might be slower but like this you have all the control on what data is being displayed there.

If you have any other questions, please let me know.


Best Regards,
Emanuel Varga
WinForms MVP
0
Manh
Top achievements
Rank 1
answered on 15 Nov 2012, 10:35 AM
Hi Emanuel Varga,

Thank you!

Manh
0
Emanuel Varga
Top achievements
Rank 1
answered on 15 Nov 2012, 10:42 AM
Hello Manh,

Glad to be able to help, if this solved your problem, please mark all appropriate answers so that other users will be able to find their answer quicker,

Thank you,

If you have any other questions, please let me know.

Best Regards,
Emanuel Varga
Winforms MVP
Tags
GridView
Asked by
Manh
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Manh
Top achievements
Rank 1
Share this question
or