GridColumnMenuCheckboxFilter how to show different display value for checkbox

3 posts, 0 answers
  1. Vikram
    Vikram avatar
    5 posts
    Member since:
    Dec 2011

    Posted 23 Sep 2020 Link to this post

    I've category column (contains unique guid) in my data[].
    While showing category column in grid, somehow I've managed to show respective category_name instead of category_id at clientside.

    I'm using GridColumnMenuCheckboxFilter to show checkbox filter with all possible filterable values.
    But all checkboxes in category filter popup shows category_id (which is default behavior), this is not readable to user.

    Can I change labels of checkboxes in category filter popup from category (i.e category_id) to category_name.

     

     

  2. Vikram
    Vikram avatar
    5 posts
    Member since:
    Dec 2011

    Posted 23 Sep 2020 in reply to Vikram Link to this post

    const ColumnMenuCheckboxFilter = (props) => {
            return (
                <div>
                    <GridColumnMenuSort {...props} />
                    <GridColumnMenuCheckboxFilter {...props} data={rows} expanded={true} uniqueData={true} />
                </div>
            );
    }



    Above is my code to show checkbox filter in columnMenu.
  3. Stefan
    Admin
    Stefan avatar
    3034 posts

    Posted 23 Sep 2020 Link to this post

    Hello, Vikram,

    In this case, we have to bound the GridColumn to the Category.CategoryName field and it will be shown as expected:

    https://stackblitz.com/edit/react-2etlqf-k95xqk?file=app/main.jsx

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top