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

Freeze/lock last/right grid columns

2 Answers 208 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marcus
Top achievements
Rank 1
Marcus asked on 16 Aug 2012, 01:48 PM
Hi everyone,
 
 we're moving from WinForms to WPF.

Our old WinForms-Application had a third-party grid which was able to group columns and freeze them on the left and right.

According to several general WPF forums (see also Telerik-GridView threads: http://www.telerik.com/community/forums/silverlight/gridview/how-to-lock-the-columns.aspx
 http://www.telerik.com/community/forums/silverlight/gridview/freezing-last-column.aspx ) freezing columns on the right seems to be a missing functionality in all(?) WPF datagrids.
 
Surely, we don't want our customers to miss that functionality, so we have written a custom control which contains two datagrids (System.Windows.Controls.DataGrid, one to the left and one to the right).
Both datagrids share the same itemssource and actions like sorting, vertical scrolling, selecting, columns/row resizing, mouse over events etc. were "synchronised".
To have a column frozen to the left, the column is "moved" (= visibilty switch) to the left datagrid, its display index is set to "FrozenColumnCount + 1" and the FrozenColumnCount is increased.
To have a column frozen to the right, the column is moved to the right datagrid where all columns were frozen.(*)

This custom control delivered a grid which was able to freeze columns on the left and the right.
Still missing was that grouping function which the old WinForms grid additionally had.

We decided to use the Telerik GridView which should replace the datagrid in our custom control.

Same procedure as mentioned...additionally we had to "synchronise" the grouping and the expanding/collapsing of each GridViewGroupRow.
Last-mentioned seems to be an unmanageable hurdle.
The "synchronising" of the grouping enables that the same GridViewGroupRows are available in both datagrids.
If a GridViewGroupRow is expanded or collapsed, we programmatically look for the GridViewGroupRow with the same group key (and parent group keys) in the other GridView and set the "IsExpanded" property to the according value. At first glance this seemed to work, but unfortunately sometimes the GridViewGroupRow stayed collapsed/expanded in the UI.
According to the debugger the property is also correctly set, the UI is not blocked.

We have no explanation for this and don't expect them here. This thread should only share our attempt to create a grid with left and right freezing and grouping functionality, in hope to gain some other valuable programmers experience/information concerning this matter and answers to following questions:

Has anyone successfully created a grid which has draggable grouping and left and right freezing functionality?

Is Telerik planning to extend the GridView with 'freezing right/last columns' functionality?

Answers why the GridViewGroupRow does sometimes not collapse/expand if this is done programmatically
(Note: Virtualization has been disabled! And even if not, the according GridViewGroupRow is available programmatically and visible in UI) ?



--------------------------------------------------------------------------
Notes only for those interesting which like to implement it that way:
(*) Left datagrid should be in a column definition with GridLength.Star, right datagrid should be in a column definition with GridLength.Auto.
Width of right datagrid must be calculated (sum each visible column width) since datagrid doesn't auto resize if columns are narrowed.

2 Answers, 1 is accepted

Sort by
0
Marcus
Top achievements
Rank 1
answered on 16 Aug 2012, 03:26 PM
Why has this thread been moved to (or created in) the Silverlight forum?
(I've definitely (also according to my browser history) created this thread in the WPF forum and never visited the Silverlight forum ever)

Please move this thread (back) to the WPF forum.
0
Dimitrina
Telerik team
answered on 20 Aug 2012, 01:02 PM
Hello,

I have moved the thread as requested.

Currently we do not have plans to add 'freezing right/last columns' functionality.  

As to the issue you have met with the GridViewGroupRow, may I ask you whether you test with the latest  version? If so, then would you please isolate the problem in a simple demo showing the case and send it to us? That way we will debug it locally to check what is wrong.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Marcus
Top achievements
Rank 1
Answers by
Marcus
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or