Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Counting Unbound Checkbox Rows
posted

I have an unbound checkbox column that the user checks to select rows.  How can I count up the number of rows clien-side the user has checked?

Parents
  • 17590
    Offline posted

    Hello Crendal,

    Thank you for posting in our community.

    From your post I assume that you have already implemented the logic for selecting/unselect rows on check/uncheck of the  UnboundCheckBox column in the grid and what you are looking for is how to get the number or currently selected rows on the client side. If this is the case, what I can suggest is using get_selectedRows method of WebDataGrid. This method gets a reference to the currently selected rows collection. Afterwards, in order to get the count of the items in this collection the get_length method could be used. For example:

    var grid = $find("WebDataGrid1");

    var selectedRowsCount = grid.get_behaviors().get_selection().get_selectedRows().get_length();

    If I this is not an accurate demonstration of what you are trying to achieve please feel free to send me a small isolated sample where  I could get a better idea of your scenario along with any clarifications if you consider them needed.

    I hope you find this information helpful.

    Please feel free to contact me if you have any additional questions regarding this matter.

Reply Children