If I have a Grid with the selection mode cell how can I get the selected cells column name and database field? I can get the row and all the items on the row but I'm having a bit of trouble finding anything with just the cell information. It would be nice to get the row and the column index also of the selected cell. I need to create a new grid by filtering with the column field.
Thanks
Thanks
3 Answers, 1 is accepted
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Jul 2013, 09:31 AM
Hello,
Please try with the below link.
http://stackoverflow.com/questions/17343371/how-to-get-row-index-and-cell-index-of-row-click-kendo-grid/17363488#17363488
Let me know if any concern.
Thanks,
Jayesh Goyani
Please try with the below link.
http://stackoverflow.com/questions/17343371/how-to-get-row-index-and-cell-index-of-row-click-kendo-grid/17363488#17363488
Let me know if any concern.
Thanks,
Jayesh Goyani
William
commented on 26 Jul 2013, 11:42 AM
Top achievements
Rank 1
Thanks- that gives the index but how do I get the cells field and column name? I need the data field for that cell so I can pass in the value as a parameter.
0
Hi William,
To get the column name you can select the header with the index of the selected cell and get it's text using this line of code:
I have prepared an example showing a possible implementation of how to see the row index and the column name of a selected cell:
http://jsbin.com/imoqav/1/edit
Regards,
Kiril Nikolov
Telerik
To get the column name you can select the header with the index of the selected cell and get it's text using this line of code:
var colName = $('#grid').find('th').eq(colIdx).text()
I have prepared an example showing a possible implementation of how to see the row index and the column name of a selected cell:
http://jsbin.com/imoqav/1/edit
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Krunal
commented on 25 Jun 2014, 10:15 AM
Top achievements
Rank 1
hello Kiril Nikolov
.text() return header text
but how to get field name???
please help me
.text() return header text
but how to get field name???
please help me
0
Hello Vinit,
You can get the dataItem on the click, and that dataItem contains all the information about the fields in the current row, as shown in this example:
http://jsbin.com/wujunera/1/edit
If this does not help, please explain in details what exactly are you looking for, so I can further assist you.
Regards,
Kiril Nikolov
Telerik
You can get the dataItem on the click, and that dataItem contains all the information about the fields in the current row, as shown in this example:
http://jsbin.com/wujunera/1/edit
If this does not help, please explain in details what exactly are you looking for, so I can further assist you.
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Alex
commented on 18 Nov 2016, 05:38 PM
Top achievements
Rank 1
The only problem with this, is that if you have the menu turned on it will include "Column Settings" in the text, which means you have to check if it contains instead of just checking the exact value
Kiril Nikolov
commented on 21 Nov 2016, 08:21 AM
Telerik team
Hi Alex,
Can you please show a sample of the problem in a separate support request? We will be happy to take a look.
Regards,
Kiril Nikolov
Telerik by Progress
Can you please show a sample of the problem in a separate support request? We will be happy to take a look.
Regards,
Kiril Nikolov
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.