How to print a static sequence of number for a particular column in Kendo Grid?

0 Answers 66 Views
Data Source Grid
vendhan
Top achievements
Rank 1
vendhan asked on 17 Dec 2021, 03:41 PM | edited on 17 Dec 2021, 03:41 PM

Hi mate,

Recently I was working with kendo grid (.net mvc project). In a particular scenario I have a list of data that has to be populated in the grid. 

for ex: the dummy grid will look like this(added with this post).

is there any possibility for me to add S.No column to act as a static one. If i drag and drop moving up and down the other three columns the S.No should be rearranged to 1,2,3 ...

Also i have another one diffuculty, I select a list of data from one page and populate the data in a grid in another page. the S.no column should be added dynamically. If i select 5 data from page 1 and the grid should  have the S.No 1,2,3,4,5 

Nikolay
Telerik team
commented on 22 Dec 2021, 06:51 AM

Hi Vendhan,

You can use the setOptions() method t dynamically update columns or add new ones. For example:

        let columns = grid.options.columns;
        //update column header template
        columns[0].headerTemplate = "dynamic template";
        grid.setOptions({ 
          columns: columns
        });

Here is a Dojo demo demonstration this: https://dojo.telerik.com/ixaPIsAr

Let me know if this is what you are looking for.

 

No answers yet. Maybe you can help?

Tags
Data Source Grid
Asked by
vendhan
Top achievements
Rank 1
Share this question
or