Group column heading hide/unhide

4 posts, 0 answers
  1. Patrick
    Patrick avatar
    4 posts
    Member since:
    Apr 2014

    Posted 07 Jun 2017 Link to this post

    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.

     

     

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2480 posts

    Posted 09 Jun 2017 Link to this post

    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.
  3. Patrick
    Patrick avatar
    4 posts
    Member since:
    Apr 2014

    Posted 09 Jun 2017 Link to this post

    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).
  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2480 posts

    Posted 13 Jun 2017 Link to this post

    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.
Back to Top