summary row format and pin

4 posts, 0 answers
  1. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 25 Nov 2012 Link to this post

    Hi,
    i'm trying to make a grid look like the attached image.  i want the total part at the bottom to look like the image.  i've tried various things and i can't even get it to pin to the bottom.  
    i found code on another thread that said to do this to get it to the bottom:
    grdTxCodes.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;
    but that doesn't work for me unless the grid has a bunch of rows in it.  when there's no rows or only a couple, the summary row is right under them.  I need it at the bottom and also need it to only show for a couple columns.  i added summary items for those columns and i do get totals, but all the other columns have what look to be cells under them that are just blank.  can those be removed?

    i blacked the data in it out for security reasons.

    Thanks!
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 29 Nov 2012 Link to this post

    Hi John,

    Thank you for contacting us.

    The requested behavior can be achieved by modifying the layout of some of the grid's elements and modifying the borders and fills of the summary elements. I am attaching a sample project which demonstrates how you can achieve this.

    Hope you find it useful. Do not hesitate to ask if you have any additional questions.

    Kind regards,
    Ivan Todorov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. John
    John avatar
    60 posts
    Member since:
    Nov 2006

    Posted 03 Dec 2012 Link to this post

    Thanks for the response Ivan.  I've been trying to make this work and i can't get it fully working.  The code you gave me pined the row to the bottom like i wanted and works good.  I can't get rid of the cell borders in my summary row though.

    I played with my code and yours and here's what i found

    if i comment out all the custom code you added to yours (3 lines):

    this.radGridView1.MasterTemplate.ViewDefinition = new MyTableViewDefinition();
    
    this.radGridView1.ViewRowFormatting += new RowFormattingEventHandler(radGridView1_ViewRowFormatting);
    this.radGridView1.ViewCellFormatting += new CellFormattingEventHandler(radGridView1_ViewCellFormatting);

    and run your project, your summary row doesn't have cell lines anyway.  Mine does.  what is adding them to mine but not yours?

    see the attached image for an example.

    Thanks!
  4. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 06 Dec 2012 Link to this post

    Hello John,

    The summary row does not have any cell borders by default, so you should not get these if you do not have any customization code. In my project I am using the ViewCellFormatting and ViewRowFormatting events to enable borders only on the cells that have values. Please make sure that you are not modifying the properties of the summary cells anywhere in your code. If you continue experiencing difficulties, please open a new support ticket and send me your project (or a sample one). This will let me investigate it and provide you with proper answer.

    Let me know if I can be of further assistance.

    All the best,
    Ivan Todorov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top