hide datePciker in grid column

1 Answer 94 Views
Grid
Masip
Top achievements
Rank 1
Iron
Masip asked on 13 Jan 2022, 05:23 PM

Hi,

Could i hide datePicke button in grid header column and only show it on mouse over ?

Regards

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 18 Jan 2022, 02:39 PM

Hi Masip,

To show the datepicker button in the Kendo UI Grid Header only when you hover over the datepicker, use the following custom approach:

ngAfterViewInit() {
  var dtp = document.querySelector(".k-datepicker");

  var dtpButton = document.querySelector(".k-datepicker .k-select");
  dtpButton['style'].visibility = "hidden";

  dtp.addEventListener("mouseenter", ()=> {
    dtpButton['style'].visibility = "visible";
  });
  dtp.addEventListener("mouseleave", ()=> {
    dtpButton['style'].visibility = "hidden";
  });
}

In this StackBlitz example, the datepicker button is visible when you enter the mouse in the datepicker in the Kendo UI Grid Header.

I hope this helps. Please let me know if I can further assist you.

Regards,
Hetali
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

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