Feb 28, 2013, 12:41 PM
[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.
Here below is my code.
==================== ASPX ==============================
======================= C# Code ==================================================
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.
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]