Aug 19, 2016, 11:08 AM
[CLOSED] GridPanel in TabPanel - toolbar is missing
Hello
I migrated my code from Ext.Net 1.7 to 3.3 and noticed that when a gridpanel is placed into a tabpanel, the gridpanel's top toolbar is not displayed (so tools are not available to a user).
Maybe there is a solution?
I attach examples in Ext.Net 1.7 (old) and 3.3 (new):
test_tabpanel_old.aspx
test_tabpanel_new.aspx
I migrated my code from Ext.Net 1.7 to 3.3 and noticed that when a gridpanel is placed into a tabpanel, the gridpanel's top toolbar is not displayed (so tools are not available to a user).
Maybe there is a solution?
I attach examples in Ext.Net 1.7 (old) and 3.3 (new):
test_tabpanel_old.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_tabpanel_old.aspx.cs" Inherits="test_tabpanel_old" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
test_tabpanel_old.aspx.csusing System;
using System.Collections.Generic;
using System.Web;
using Ext.Net;
public partial class test_tabpanel_old : System.Web.UI.Page
{
public class TestData
{
public static List<object> Data
{
get
{
return new List<object>
{
new {ID = 10},
new {ID = 20},
new {ID = 30}
};
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
ResourceManager res_man = new ResourceManager() { ID = "res_man" };
res_man.IDMode = IDMode.Explicit;
res_man.ViewStateMode = System.Web.UI.ViewStateMode.Disabled;
res_man.DirectMethodNamespace = "net";
form1.Controls.Add(res_man);
Viewport viewport1 = new Viewport() { ID = "viewport1", Layout = "Border" };
BorderLayout vp_layout1 = new BorderLayout();
viewport1.Items.Add(vp_layout1);
TabPanel tabpanel1 = new TabPanel() { ID = "tabpanel1", DeferredRender = false };
vp_layout1.Center.Items.Add(tabpanel1);
GridPanel grid1 = new GridPanel() { ID = "grid1", Title = "Grid1" };
grid1.Tools.Add(new Tool() { Type = ToolType.Print });
grid1.ColumnModel.Columns.Add(new Column() { DataIndex = "ID", Header = "ID" });
Store store1 = new Store() { ID = "store1" };
store1.Reader.Add(new JsonReader());
store1.AddField(new RecordField("ID", RecordFieldType.Auto));
grid1.Store.Add(store1);
if (!X.IsAjaxRequest)
{
store1.DataSource = TestData.Data;
store1.DataBind();
}
tabpanel1.Add(grid1);
form1.Controls.Add(viewport1);
}
}
test_tabpanel_new.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_tabpanel_new.aspx.cs" Inherits="test_tabpanel_new" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
test_tabpanel_new.aspx.csusing System;
using System.Collections.Generic;
using System.Web;
using Ext.Net;
public partial class test_tabpanel_new : System.Web.UI.Page
{
public class TestData
{
public static List<object> Data
{
get
{
return new List<object>
{
new {ID = 10},
new {ID = 20},
new {ID = 30}
};
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
ResourceManager res_man = new ResourceManager() { ID = "res_man" };
res_man.IDMode = IDMode.Explicit;
res_man.ViewStateMode = System.Web.UI.ViewStateMode.Disabled;
res_man.DirectMethodNamespace = "net";
form1.Controls.Add(res_man);
Viewport viewport1 = new Viewport() { ID = "viewport1", Layout = "BorderLayout" };
TabPanel tabpanel1 = new TabPanel() { ID = "tabpanel1", DeferredRender = false, Region = Region.Center };
viewport1.Items.Add(tabpanel1);
GridPanel grid1 = new GridPanel() { ID = "grid1", Title = "Grid1" };
grid1.Tools.Add(new Tool() { Type = ToolType.Print });
grid1.ColumnModel.Columns.Add(new Column() { DataIndex = "ID", Text = "ID" });
Store store1 = new Store() { ID = "store1" };
Model model1 = new Model();
model1.Fields.Add(new ModelField("ID", ModelFieldType.Auto));
store1.Model.Add(model1);
grid1.Store.Add(store1);
if (!X.IsAjaxRequest)
{
store1.DataSource = TestData.Data;
store1.DataBind();
}
tabpanel1.Add(grid1);
form1.Controls.Add(viewport1);
}
}
Last edited by fabricio.murta; Sep 06, 2016 at 2:28 PM.