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

Getting Row Type Client Side

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tracy
Top achievements
Rank 1
Tracy asked on 23 Jan 2018, 06:20 PM

Hi,

How can I get the grid row type when looping through all rows in grid client side.

         

           var masterTable = $find("<%=rgvMainGrid.ClientID%>").get_masterTableView();
           var rowCount = masterTable.get_element().rows.length;
           for (var i = 0; i < rowCount; i += 1) {
//Get Type Of Row Here (ie. GroupHeader, Data Row, GroupFooter)
}

 

Also, is there a complete list of the Client API objects.  I found a Client Side Programming Overview document but it only has few of the objects listed. 

For example, the documentation lists the .get_masterTableView() but I don't see anything on 

.get_masterTableView().getCellByColumnUniqueName or .get_masterTableView().get_element().rows.length

 

Thank You

Tracy

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 26 Jan 2018, 08:29 AM
Hi Tracy,

There are different Telerik objects related to the grid structure. The main methods and properties you can find enlisted in these articles:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/radgrid-object/radgrid-class-members
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/gridtableview-class-members
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/griddataitem-object/griddataitem-class-members
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridcolumn-object/gridcolumn-class-members

There is no common collection to hold all types of grid items, but there is a direct method to get the GridDataItem objects - grid.get_masterTableView().get_dataItems(). I hope this will prove helpful to your specific scenario.

If you have different requirements or further instructions, please elaborate on what exactly you want to achieve and send us sample screenshots or video demonstrating the exact desired behavior.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Tracy
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or