How to remove GridViewSummaryRowItem from RadGridView.

4 posts, 0 answers
  1. Mohammad
    Mohammad avatar
    2 posts
    Member since:
    Mar 2012

    Posted 12 Apr 2012 Link to this post

    Hi,

    Background:

    I am populate a grid on certain criteria which user selects within a form. When user press the Load Data button, the data is getting loaded into the RadGridView along with a SummaryRow on the top of the grid.

    I have a clear data button which currently clears the grid by setting the DataSource property to null.

    Issue:

    When user hit the Clear Data button alothough it clears out all the data but leaves that Summary row on the top, which is an issue.

    My question is - Is there a way to remove the GridViewSummaryRowItem or any way I can refresh the whole grid which removes the SummaryRow.

    Thanks.
    Regards
    Mohammad
  2. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 17 Apr 2012 Link to this post

    Hi Mohammad,

    Thank you for writing.

    I made a sample test according to your description and when I set the DataSource of the grid to null it shows the "No data to display" string and the rows, columns and the summary row are not displayed. Attached you can find a sample project demonstrating this.

    However, you can always call the Clear method of the desired summary row collection:
    this.radGridView1.SummaryRowsTop.Clear();

    I hope that you find the provided information useful. Let us know if you have any other questions.
     
    Kind regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. Mohammad
    Mohammad avatar
    2 posts
    Member since:
    Mar 2012

    Posted 17 Apr 2012 Link to this post

    Hi Stefan,

    Thank you very much for writing it back with a nice and simple solution demonstrating the desired functionality. This is exectly what I was looking for, thank you very much for taking time to do this.

    I'm very impressed with response which was really helpful and did resolve the issue I was facing.

    Thanks again.

    Regards
    Mohammad
  4. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 20 Apr 2012 Link to this post

    Hi Mohammad,

    You are very welcome. Should you have any other questions, do not hesitate to contact us.
     
    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top