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

Color picker template in grid filter

1 Answer 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
christophe
Top achievements
Rank 1
christophe asked on 03 Sep 2018, 03:05 PM

Hello everyone,

 

I have a column in my grid which contains colors.

I would like to offer the possibility for the user to filter with a color palette, instead of typing the hexadecimal value.

 

I found an example close to what I want in javascript, but I don't know how to use Kendo Color Palette instead of Color Picker :     

https://dojo.telerik.com/inawEYOH

 

Do you know how to do this in the MVC core way (using Razor) ?

 

Regards,

Christophe.

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 05 Sep 2018, 11:07 AM
Hello Christophe,

By default the Grid component will render input element in the filter. However the ColorPalette widget can be initialized from a div element. This is why the palette is not displayed in the dojo. 

In case having a ColorPalette is a must a bit more logic would be required to customize the filter. You can create a div element manually and initialize ColorPalette from it. Then remove the input element that will be available by default. Finally add handler for the ColorPalette change event and filter the data in the Grid.

The example below illustrates the functionality. 


Give the approach a try and let me know how it works for you.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
christophe
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or