This is a migrated thread and some comments may be shown as answers.

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

12 Answers 245 Views
GridView
This is a migrated thread and some comments may be shown as answers.
VT400933
Top achievements
Rank 1
VT400933 asked on 27 Oct 2010, 07:08 PM
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!

12 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 27 Oct 2010, 09:49 PM
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
0
VT400933
Top achievements
Rank 1
answered on 28 Oct 2010, 01:32 AM
Works like a charm.....Thank you very much, Emanuel!!!!
0
VT400933
Top achievements
Rank 1
answered on 05 Nov 2010, 06:25 AM
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.
0
Emanuel Varga
Top achievements
Rank 1
answered on 05 Nov 2010, 08:00 AM
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
0
VT400933
Top achievements
Rank 1
answered on 05 Nov 2010, 01:03 PM
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. 
0
Emanuel Varga
Top achievements
Rank 1
answered on 05 Nov 2010, 03:17 PM
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
0
phani potturu
Top achievements
Rank 1
answered on 12 Nov 2010, 07:13 AM

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
                });
            }
        }
    }
}

0
Jack
Telerik team
answered on 17 Nov 2010, 02:23 PM
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>>
0
Rehmak
Top achievements
Rank 1
answered on 19 Sep 2017, 08:45 AM

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

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Sep 2017, 09:44 AM
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.
0
Rehmak
Top achievements
Rank 1
answered on 19 Sep 2017, 10:27 AM

i am unable to find this property "BottomPinnedRowsMode".

how can i set this ""

this.dgv. ??

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Sep 2017, 10:14 AM
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.
Tags
GridView
Asked by
VT400933
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
VT400933
Top achievements
Rank 1
phani potturu
Top achievements
Rank 1
Jack
Telerik team
Rehmak
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or