I have an SPGridView and when grouping on it, it displays groups perfectly.

However, in the SharePoint native list view, we can specify the view to filter and grouping on some columns etc.

When using grouping, the native list displays the number of element inside the group just front of the group name as you can see in the screenshot below:

enter image description here

So how do I do the same on my SPGridView ? I would prefer a solution that does not involve the use of JQuery or JavaScript. Nevertheless, if there is no standard procedure to do it (adding attributes, enable some options, etc) I accept any other solution. Thank you.

1 Answer 1


Obviously, it is not possible to enable any count option on SPGridView. Instead I had to use JS to count every lines in the group and then modify the DOM dynamicaly by adding the number of line next to the group label.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.