"Click here for new row" needs to appear before Summary Row in the bottom

13 posts, 1 answers
  1. VT400933
    VT400933 avatar
    4 posts
    Member since:
    Jun 2010

    Posted 27 Oct 2010 Link to this post

    Hi,

    The grid I am using in my app has a summary row added in the bottom. It also has the AllowNewRowPosition set to bottom. This causes the "Click here to add a new row" to appear in the bottom. The user is requesting that I move the Summary row to the bottom most position and have the "Click here to add a new row" appear right before the Summary Row.

    has anyone done this? Any help on this would be greatly appreciated.


    Thanks!
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 27 Oct 2010 Link to this post

    Hello Jay,

    You can pin the Summary Row to the bottom of the grid to be always visible, and like that, when you get to the end of the grid, the summary row will be after the new row.

    You can pin the row using:
    radGridView1.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;
    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  3. VT400933
    VT400933 avatar
    4 posts
    Member since:
    Jun 2010

    Posted 27 Oct 2010 Link to this post

    Works like a charm.....Thank you very much, Emanuel!!!!
  4. VT400933
    VT400933 avatar
    4 posts
    Member since:
    Jun 2010

    Posted 05 Nov 2010 Link to this post

    Emanuel, I do have a different problem after I pin the summary row position. 

    The summary is row is getting pinned but when I have the records in the grid fill the entire grid, the new row added is hiding behind the pinned summary row.

    Any ideas? Appreciate your response.
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 05 Nov 2010 Link to this post

    Hello again,

    From your screenshot i cannot tell if you can scroll down more or not. If you can, this is the expected behavior because the summary pinned row is supposed to be always visible, and the new row is behaving like any other row.

    Please let me know if you can scroll down or not.

    Best Regards,
    Emanuel Varga
  6. VT400933
    VT400933 avatar
    4 posts
    Member since:
    Jun 2010

    Posted 05 Nov 2010 Link to this post

    Emanuel,

    Thanks for your reply. You are correct, I can scroll down and if I do, then I can see the record and edit it.

    I was hoping to find a way to not have the row hide behind the pinned row. The other option I tried is to automatically scroll to the new row and begin edit on one of the cell in the currentrowchanging or currentrowchanged event but it is not scrolling automatically.

    I am sure I am missing something, but I just can't seem to get access to the new row in the grid before the data is submitted. 
  7. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 05 Nov 2010 Link to this post

    Hello,

    Sadly i cannot reproduce this, you could try calling .EnsureVisible() on CellBeginEdit, but when you start editing the cell should already be visible, please try to reproduce this in the following example, and if you can, please tell me how to...:
    using System.ComponentModel;
    using System.Windows.Forms;
    using Telerik.WinControls.UI;
     
    public partial class Form1 : Form
    {
        private RadGridView radGridView1;
     
        public Form1()
        {
            InitializeComponent();
            LoadGrid();
            LoadSummaryRow();
        }
     
        private void LoadSummaryRow()
        {
            var summaryItem = new GridViewSummaryItem("Id", "Result {0}", GridAggregateFunction.Sum);
            var summaryRow = new GridViewSummaryRowItem(new GridViewSummaryItem[] { summaryItem });
            radGridView1.SummaryRowsTop.Add(summaryRow);
            radGridView1.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;
        }
     
        private void LoadGrid()
        {
            this.Controls.Add(radGridView1 = new RadGridView());
            radGridView1.AllowAddNewRow = true;
            radGridView1.AddNewRowPosition = SystemRowPosition.Bottom;
            radGridView1.Dock = DockStyle.Fill;
            radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            var checkBoxColumn = new GridViewCheckBoxColumn("Modified");
            checkBoxColumn.Width = 1;
            checkBoxColumn.MaxWidth = 1;
            radGridView1.Columns.Add(checkBoxColumn);
            radGridView1.DataSource = new IdValuesCollection(100);
        }
    }
     
    public class IdValue
    {
        public int Id
        {
            get;
            set;
        }
     
        public string IdName
        {
            get;
            set;
        }
     
        public override string ToString()
        {
            return IdName;
        }
    }
     
    public class IdValuesCollection : BindingList<IdValue>
    {
        public IdValuesCollection(int noItems)
        {
            for (int i = 0; i < noItems; i++)
            {
                this.Add(new IdValue
                {
                    Id = i,
                    IdName = "IdName" + i
                });
            }
        }
    }
    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  8. phani potturu
    phani potturu avatar
    1 posts
    Member since:
    Oct 2009

    Posted 12 Nov 2010 Link to this post

    Hi Emanuel ,

    You can reproduce the problem in your sample code by commenting the AutoSizeColumnsMode setting.


    //radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

    set

     

    radGridView1.HorizontalScrollState = ScrollState.AlwaysShow;

     

     

     

     

    ( the horizontal scroll bar should be visible to recreate the problem)
    When you AutoSizeColumnsMode is set to none, the new row and the summary row are sharing same grid area.

     

     


    Our code is working fine with AutoSizeColumnsMode set to fill, however this setting is auto assigning the columns widths. This is not acceptable as I must show the full column header text in the grid.


    Is there any way I can set the AutoSizeColumnsMode  to fill and also have the ability to set the column widths to the size of the column header.
    Thanks
    Phani


    Code to reproduce the problem:

     

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    namespace EOG.ProdApps.FDC.WF
    {
        using System.ComponentModel;
        using System.Windows.Forms;
        using Telerik.WinControls.UI;

        public partial class Form1 : Form
        {
            private RadGridView radGridView1;

            public Form1()
            {
                InitializeComponent();
                LoadGrid();
                LoadSummaryRow();
            }

            private void LoadSummaryRow()
            {
                var summaryItem = new GridViewSummaryItem("Id", "Result {0}", GridAggregateFunction.Sum);
                var summaryRow = new GridViewSummaryRowItem(new GridViewSummaryItem[] { summaryItem });
                radGridView1.SummaryRowsTop.Add(summaryRow);
                radGridView1.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;
            }

            private void LoadGrid()
            {
                this.Controls.Add(radGridView1 = new RadGridView());
                radGridView1.AllowAddNewRow = true;
                radGridView1.AddNewRowPosition = SystemRowPosition.Bottom;
                radGridView1.Dock = DockStyle.Fill;
               // radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
                var checkBoxColumn = new GridViewCheckBoxColumn("Modified");
                checkBoxColumn.Width = 1;
                checkBoxColumn.MaxWidth = 1;
                radGridView1.Columns.Add(checkBoxColumn);
                radGridView1.DataSource = new IdValuesCollection(100);
               
                radGridView1.HorizontalScrollState = ScrollState.AlwaysShow;
                radGridView1.TableElement.ScrollToRow(radGridView1.Rows.Count - 1);
            }
        }

        public class IdValue
        {
            public int Id
            {
                get;
                set;
            }

            public string IdName
            {
                get;
                set;
            }

            public override string ToString()
            {
                return IdName;
            }
        }

        public class IdValuesCollection : BindingList<IdValue>
        {
            public IdValuesCollection(int noItems)
            {
                for (int i = 0; i < noItems; i++)
                {
                    this.Add(new IdValue
                    {
                        Id = i,
                        IdName = "IdName" + i
                    });
                }
            }
        }
    }

  9. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 17 Nov 2010 Link to this post

    Hi phani,

    Thank you for reporting this issue. I managed to reproduce it, however I was not able to find a suitable work around. I added the issue in our issue tracking system and it will be addressed in one of our upcoming service packs. I updated your Telerik points accordingly.

    If you have any questions, please write us back.

    All the best, Jack
    the Telerik team
    See What's New in RadControls for WinForms in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
  10. Rehmak
    Rehmak avatar
    4 posts
    Member since:
    Aug 2013

    Posted 19 Sep 2017 Link to this post

    Hello

    i want to pin the summary at bottom, i tried many ways but can't find help.

     

    Here is my code:

    GridViewSummaryItem summaryItem = new GridViewSummaryItem();
                  summaryItem.Name = "rate";
                  summaryItem.Aggregate = GridAggregateFunction.Sum;
                  summaryItem.FormatString = "Total:{0}";
     
                  GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem();
                  summaryRowItem.Add(summaryItem);
     
                  summaryItem = new GridViewSummaryItem();
                  summaryItem.Name = "Discount";
                  summaryItem.Aggregate = GridAggregateFunction.Sum;
                  summaryItem.FormatString = "Total:{0}";
                  summaryRowItem.Add(summaryItem);
     
                  summaryItem = new GridViewSummaryItem();
                  summaryItem.Name = "NetTotal";
                  summaryItem.Aggregate = GridAggregateFunction.Sum;
                  summaryItem.FormatString = "Total:{0}";
                  summaryRowItem.Add(summaryItem);
     
                  this.dgv.SummaryRowsBottom.Add(summaryRowItem);
     
                  this.dgv.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;

     

    and see the attached screen shot, the result i am getting

     

  11. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3530 posts

    Posted 19 Sep 2017 Link to this post

    Hello, Rehmak, 

    Thank you for writing.  

    Please refer to the last section in the following help article: http://docs.telerik.com/devtools/winforms/gridview/rows/summary-rows

    You can control the location of the bottom summary rows by the BottomPinnedRowsMode property. There are two available options: Fixed and Float. When you use the Fixed mode, it is necessary to pin the summary row accessing them by the MasterView.SummaryRows collection. Make sure to set the IsPinned property before setting the PinPosition.

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  12. Rehmak
    Rehmak avatar
    4 posts
    Member since:
    Aug 2013

    Posted 19 Sep 2017 Link to this post

    i am unable to find this property "BottomPinnedRowsMode".

    how can i set this ""

    this.dgv. ??

  13. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3530 posts

    Posted 20 Sep 2017 Link to this post

    Hello, Rehmak, 

    Thank you for writing back. 

    The BottomPinnedRowsMode property was introduced in R3 2016 SP1 along with this feedback item: https://feedback.telerik.com/Project/154/Feedback/Details/110991-add-radgridview-allow-pinned-items-position-modification-in-order-to-be-able-t

    If you are using a previous version, feel free to upgrade in order to benefit from the introduced improvements. I have attached a sample project for your reference demonstrating how to pin the summary rows to the bottom.

    I hope this information helps. If you have any additional questions, please let me know. 

      Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top