Column menu not showing when using Custom column header

1 Answer 522 Views
Grid
Lucien
Top achievements
Rank 1
Iron
Lucien asked on 28 May 2022, 03:37 AM

Hi all,

I have a grid design like this :

I am trying to add an icon  into my column header and make a pop-up after hovering it.

I use headerCell to set up the icon, however,  but the column menu will then strangely disappear. 

Is there any way to configure the column header and at the same time the column menu stays visible and workable ?

 

Any help will be appreciated

1 Answer, 1 is accepted

Sort by
1
Filip
Telerik team
answered on 30 May 2022, 11:08 AM

Hi, Lucien,

Thank you for reaching out to us.

This behavior occurs because in the latest versions we have introduced a change in the headerCell which gives more freedom to the developer to manipulate the columnMenu icon.

This however requires a different configuration in the custom headerCell in order to show the columnMenu icon:

const HeaderCell = (props) => (
  <React.Fragment>
    <span className="k-cell-inner">
      <span className="k-link" onClick={props.onClick}>
        <span className="k-column-title">
          {props.title}
          {props.children}
        </span>
      </span>
      <GridColumnMenuWrapper
        {...props.columnMenuWrapperProps}
      ></GridColumnMenuWrapper>
    </span>
  </React.Fragment>
);

Here is a runnable example that showcases this approach:

https://stackblitz.com/edit/react-febfzz-5htto3?file=app/main.jsx


I hope this helps.

Regards, FilipProgress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Lucien
Top achievements
Rank 1
Iron
commented on 30 May 2022, 01:11 PM

Thanks Filip, it works well now !

Tags
Grid
Asked by
Lucien
Top achievements
Rank 1
Iron
Answers by
Filip
Telerik team
Share this question
or