PDA

View Full Version : [CLOSED] Auto Move GridPanel horizontal scroll bar?



mis@adphk.com
Sep 10, 2013, 10:05 AM
For Exampe: I have 50 columns in GridPanel. I assume first column is Locked!!
Now User Click Button1 -> GridPanel Horizontal Scroll to Column 10
Now User Click Button2 -> GridPanel Horizontal Scroll to Column 20
is it possible ?

Daniil
Sep 10, 2013, 12:35 PM
Hi mis@adphk.com,

This example demonstrates how to scroll.

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[] { "test" }
};

for (int i = 0; i < 50; i++)
{
GridPanel1.ColumnModel.Columns.Add(new Column() { Text = "Column " + i });
}
}
}
</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="200">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column
runat="server"
Text="Locked"
DataIndex="test"
Locked="true" />
</Columns>
</ColumnModel>
</ext:GridPanel>

<ext:Button
runat="server"
Text="Scroll"
Handler="App.GridPanel1.normalGrid.body.child('div').scroll ('l', 500);" />
</form>
</body>
</html>

mis@adphk.com
Sep 18, 2013, 4:05 AM
it works thanks.