[OPEN] [#160] GridPanel Scroll Bar does not move automatically when the column is dragged to the extreme right.

Page 1 of 2 12 LastLast
  1. #1

    [OPEN] [#160] GridPanel Scroll Bar does not move automatically when the column is dragged to the extreme right.

    Hello Team,
    I have a grid panel with some columns, where I have the scroll bar visible for the Grid.
    I want to drag the column and place it to the extreme right(last column position), but the horizontal scroll bardoes not move automatically. Please check the attachment.Click image for larger version. 

Name:	DragNDropColumnIssue.JPG 
Views:	73 
Size:	58.6 KB 
ID:	5737

    Here below is my code.
    ==================== ASPX ==============================
    <ext:GridPanel ID="GridPanel1" runat="server" Title="Employees" Height="600"
            Width="500">
            <Store>
                <ext:Store ID="StoreEmployees" runat="server">
                    <Model>
                        <ext:Model ID="Model1" runat="server" IDProperty="EmployeeID">
                            <Fields>
                                <ext:ModelField Name="FirstName" />
                                <ext:ModelField Name="LastName" />
                                <ext:ModelField Name="Title" />
                                <ext:ModelField Name="TitleOfCourtesy" />
                                <ext:ModelField Name="Address" />
                                <ext:ModelField Name="City" />
                                <ext:ModelField Name="Region" />
                                <ext:ModelField Name="PostalCode" />
                                <ext:ModelField Name="Country" />
                                <ext:ModelField Name="HomePhone" />
                                <ext:ModelField Name="Extension" />
                                <ext:ModelField Name="Notes" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column ID="fullName" runat="server" Text="Full Name" Width="150" DataIndex="LastName" />
                    <ext:Column ID="Column1" runat="server" DataIndex="Title" Text="Title" Width="150" />
                    <ext:Column ID="Column2" runat="server" DataIndex="TitleOfCourtesy" Text="Title Of Courtesy"
                        Width="150" />
                    <ext:Column ID="Column3" runat="server" DataIndex="Address" Text="Address" Width="150" />
                    <ext:Column ID="Column4" runat="server" DataIndex="City" Text="City" Width="100" />
                    <ext:Column ID="Column5" runat="server" DataIndex="Region" Text="Region" Width="100" />
                    <ext:Column ID="Column6" runat="server" DataIndex="PostalCode" Text="PostalCode"
                        Width="100" />
                    <ext:Column ID="Column7" runat="server" DataIndex="Country" Text="Country" Width="100" />
                    <ext:Column ID="Column8" runat="server" DataIndex="HomePhone" Text="HomePhone" Width="150" />
                    <ext:Column ID="Column9" runat="server" DataIndex="Extension" Text="Extension" Width="100" />
                </Columns>
            </ColumnModel>
            <View>
                <ext:GridView ID="GridView1" runat="server">
                    <GetRowClass Handler="return 'x-grid-row-expanded';" />
                </ext:GridView>
            </View>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Multi" />
            </SelectionModel>
        </ext:GridPanel>
    ================================================== =============================

    ======================= C# Code ==================================================
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    public partial class DragNDropColumns : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            StoreEmployees.DataSource = GetEmployeeData();
            StoreEmployees.DataBind();
        }
    
    
        public static List<Employee> GetEmployeeData()
        {
    
            List<Employee> lstEmployees = new List<Employee>();
            for (int i = 0; i < 20; i++)
            {
                Employee objEmp = new Employee();
                objEmp.EmployeeID = i.ToString();
                objEmp.FirstName = "FirstName_" + i.ToString();
                objEmp.LastName = "LastName_" + i.ToString();
                objEmp.Title = "Title_" + i.ToString();
                objEmp.TitleOfCourtesy = "TitleOfCourtesy_" + i.ToString();
                objEmp.Address = "Address_" + i.ToString();
                objEmp.City = "City_" + i.ToString();
                objEmp.Region = "Region_" + i.ToString();
                objEmp.PostalCode = "PostalCode_" + i.ToString();
                objEmp.Country = "Country_" + i.ToString();
                objEmp.HomePhone = "HomePhone_" + i.ToString();
                objEmp.Extension = "Extension_" + i.ToString();
                objEmp.Notes = "Notes_" + i.ToString();
    
                lstEmployees.Add(objEmp);
            }
    
            return lstEmployees;
        }
    }
    
    
    public class Employee
    {
        string _EmployeeID;
        string _FirstName;
        string _LastName;
        string _Title;
        string _TitleOfCourtesy;
        string _Address;
        string _City;
        string _Region;
        string _PostalCode;
        string _Country;
        string _HomePhone;
        string _Extension;
        string _Notes;
    
        public string EmployeeID
        {
            get { return _EmployeeID; }
            set { _EmployeeID = value; }
        }
    
    
        public string FirstName
        {
            get { return _FirstName; }
            set { _FirstName = value; }
        }
    
        public string LastName
        {
            get { return _LastName; }
            set { _LastName = value; }
    
        }
        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }
        public string TitleOfCourtesy
        {
            get { return _TitleOfCourtesy; }
            set { _TitleOfCourtesy = value; }
        }
        public string City
        {
            get { return _City; }
            set { _City = value; }
        }
        public string Region
        {
            get { return _Region; }
            set { _Region = value; }
        }
        public string PostalCode
        {
            get { return _PostalCode; }
            set { _PostalCode = value; }
        }
        public string Country
        {
            get { return _Country; }
            set { _Country = value; }
        }
        public string HomePhone
        {
            get { return _HomePhone; }
            set { _HomePhone = value; }
        }
        public string Extension
        {
            get { return _Extension; }
            set { _Extension = value; }
        }
        public string Notes
        {
            get { return _Notes; }
            set { _Notes = value; }
        }
        public string Address
        {
            get { return _Address; }
            set { _Address = value; }
        }
    }
    ================================================== =============================
    Last edited by Daniil; Mar 06, 2013 at 5:27 AM. Reason: [OPEN] [#160]
  2. #2
    Yes, it is known bug, unfortunately Sencha did not fix it yet
    I suggest to add the following listener to the grid and when drag a column then move cursor over horizontal scroller

    <AfterRender Handler=" Ext.dd.ScrollManager.register(this.getView().el); " />
  3. #3
    Hey Vladimir,
    I appreciate your quick response, it works rarely, is there any other alternate method to do that?
  4. #4
    Unfortunately, I don't know another workaround (only if move column in few steps, move->scroll->move)
    What you mean 'rarely'? I tried and it seems that scroll is performed always when move cursor over horizontal scroll during dragging
  5. #5
    Quote Originally Posted by Vladimir View Post
    Unfortunately, I don't know another workaround (only if move column in few steps, move->scroll->move)
    What you mean 'rarely'? I tried and it seems that scroll is performed always when move cursor over horizontal scroll during dragging
    hello Vladimir,

    There are around 150 columns in the grid, so it will be difficult for the user to do move->scroll->move, which might take atleast 15 scrolls. I said it rarely because it worked only once for me out of 20 trials. I really appreciate if you can attach the sample you tried with(along with the screenshot if possible).
  6. #6
    I re-reported this issue to Sencha. Interesting whether they will open a bug ticket or not.
    http://www.sencha.com/forum/showthread.php?257932

    Quote Originally Posted by Tarun Chand View Post
    hello Vladimir,

    There are around 150 columns in the grid, so it will be difficult for the user to do move->scroll->move, which might take atleast 15 scrolls. I said it rarely because it worked only once for me out of 20 trials. I really appreciate if you can attach the sample you tried with(along with the screenshot if possible).
    I tested with the example below. The workaround suggested by Vladimir works, but I agree it is not too useful if there are 150 columns.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3" },
                    new object[] { "test4", "test5", "test6" },
                    new object[] { "test7", "test8", "test9" }
                };
                store.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" Width="300" Height="150">
                <Store>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test1" />
                                    <ext:ModelField Name="test2" />
                                    <ext:ModelField Name="test3" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="Test1" DataIndex="test1" />
                        <ext:Column runat="server" Text="Test2" DataIndex="test2" />
                        <ext:Column runat="server" Text="Test3" DataIndex="test3" />
                        <ext:Column runat="server" Text="Test4" DataIndex="test1" />
                        <ext:Column runat="server" Text="Test5" DataIndex="test2" />
                        <ext:Column runat="server" Text="Test6" DataIndex="test3" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  7. #7
    Quote Originally Posted by Daniil View Post
    I re-reported this issue to Sencha. Interesting whether they will open a bug ticket or not.
    http://www.sencha.com/forum/showthread.php?257932



    I tested with the example below. The workaround suggested by Vladimir works, but I agree it is not too useful if there are 150 columns.

    Daniil,

    Good to know that you have re-reported the bug. I feel now Ext.Net control provides rich set of options/functionalities, only this drag and drop of columns to extreme end is missing.

    Daniil I tested the code you have given in the previous post, but when I used the same code tried accessing the page in browser, it throws some javascript error. Please check this screenshot.Click image for larger version. 

Name:	DragNDropColumnIssue_1.JPG 
Views:	48 
Size:	88.9 KB 
ID:	5759

    This is the error message I have copied from the browser error console.
    ============== JS ERROR ============================

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; MS-RTC LM 8)
    Timestamp: Tue, 5 Mar 2013 07:29:46 UTC

    Message: 'header' is null or not an object
    Line: 1300
    Char: 151
    Code: 0
    URI: http://localhost:1646/ExtNetV2_1Demo...xt.axd?v=18122

    ================================================== =====


    IE : 8.0.6001.18702
    Ext.Net Ver : 2.1.1
    .Net Framework: 3.5, VS2008


    I tried in mozilla, it fails there too.
  8. #8
    It is a known bug and was fixed. Please update from SVN.
  9. #9
    Quote Originally Posted by Daniil View Post
    I re-reported this issue to Sencha. Interesting whether they will open a bug ticket or not.
    http://www.sencha.com/forum/showthread.php?257932
    Sencha opened a ticket for this problem.

    We created an Issue to monitor.
    https://github.com/extnet/Ext.NET/issues/160
  10. #10
    Daniil,

    This workaround code works fine, but I have a CheckboxSelectionModel in the grid so when I add a CheckboxSelectionModel column to this, it does not work...!

    Please guide me to overcome this problem.
    Last edited by Tarun_Chand; Mar 11, 2013 at 8:15 AM.
Page 1 of 2 12 LastLast

Similar Threads

  1. Paging - Automatically move to last record
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Nov 11, 2011, 7:16 PM
  2. [CLOSED] disable column move in gridpanel
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 14, 2011, 7:36 AM
  3. Replies: 3
    Last Post: Apr 08, 2010, 7:16 AM
  4. [CLOSED] [1.0] gridpanel multi header + column move
    By brettmas in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 28, 2010, 5:20 AM
  5. [CLOSED] [1.0] Gridpanel excel like column lock scroll
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 04, 2010, 5:23 PM

Tags for this Thread

Posting Permissions