blazor telerik grid indicate sortable column

1 Answer 49 Views
Grid
bimal
Top achievements
Rank 1
Iron
bimal asked on 19 Feb 2025, 02:03 PM

Hi folks,

I would like to show some icon next to a column that indicates that the column can be sorted or not. I have set the Sortable="true" at the grid level and for one of the grid column the sortable is set as false.

Any suggestions on how to implement this feature?

Thanks,
Bimal 

1 Answer, 1 is accepted

Sort by
0
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
answered on 19 Feb 2025, 04:12 PM
Hi Bimal,

By default, the Grid does not automatically sort the provided data, which is why no sorting indication is shown. To address this, I typically handle the OnStateInit event, which allows setting an initial state for the Grid. In this event handler, I add a Sort Descriptor to sort the first column upon initialization.

For more details, you can refer to the official documentation: https://www.telerik.com/blazor-ui/documentation/components/grid/state#onstateinit

Regards,
Anislav Atanasov

Tags
Grid
Asked by
bimal
Top achievements
Rank 1
Iron
Answers by
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Share this question
or