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

Group column heading hide/unhide

3 Answers 180 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 07 Jun 2017, 10:22 PM

We have 4 record tracking columns UserID & Date, One set for create and one set for last modified. We initially have them all hidden in our grid. When using the grid context menu you cannot tell one set from the other because it only shows the group title in the menu. I could probably live with that, but if you unhide only one of the 2 in the group. You do not get the grouping title and there cannot tell which one it is. Below is the grid code for the 4 columns described.

//CREATED COLUMNS
columns.Group(groupCR => groupCR
.Title("Created").HeaderHtmlAttributes(new { @style = "text-align:center;" }).Hidden(true)
.Columns(CRgrp =>
{
    CRgrp.Bound(p => p.CREATE_USERID).Width(100).Title("User").Width(80).ClientTemplate("<a onMouseOver=\"showName(this, '#=CREATE_USERID#')\">#=CREATE_USERID#</a>");
    CRgrp.Bound(p => p.CREATE_DT).Format("{0:d}").Title("Date").Width(80);
})
);
//MODIFIED COLUMNS
columns.Group(groupMD => groupMD
.Title("Modified").HeaderHtmlAttributes(new { @style = "text-align:center;" })
.Columns(MDgrp =>
{
    MDgrp.Bound(p => p.MODIFIED_USERID).Width(100).Title("User").Width(80).ClientTemplate("<a onMouseOver=\"showName(this, '#=MODIFIED_USERID#')\">#= MODIFIED_USERID != null ? MODIFIED_USERID : '' #</a>");
    MDgrp.Bound(p => p.MODIFIED_DT).Format("{0:d}").Title("Date").Width(80);
})

);

 

Any help would be appreciated.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 09 Jun 2017, 01:54 PM
Hello Patrick,

I tried to replicate the behavior you describe, however, I was not able to.  I tested the behavior with the sample below and the corresponding column group is displayed as expected when showing a column. Please check out the dojo sample below and let me know how it works for you. 


Would you modify it in a way that the behavior you are seeing is replicated and send it back?


Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Patrick
Top achievements
Rank 1
answered on 09 Jun 2017, 02:44 PM
I guess I am losing my mind about the group heading not displaying, but when viewing the column list in the context menu, you cannot tell one from another. Imagine you have 2 sets of address columns. One grouped as "Shipping" and one grouped as "Billing". Each one has columns titles "Address", 'City", "State", "Zip". Imagine they are all hidden initially. The user wants to unhide the "Billing Address". He cannot tell one from another because the both say "Address" in the content menu. In my opinion, it should look like the attached (sorry for quality just made quick render using paint).
0
Viktor Tachev
Telerik team
answered on 13 Jun 2017, 10:42 AM
Hi Patrick,

The context menu in Grid is using the Title that is specified for the columns. Thus, you should change the titles for the columns in order for the entries in the context menu to be different. 

Another approach is to handle the contextMenuInit event for the Grid and iterate through the items in the menu. Note that this approach would require custom logic. You can see a simplified example in the dojo below:




Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Patrick
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or