Dec 04, 2012, 10:58 AM
[CLOSED] Adding aspx Gridpanel to dynamically created tab
Hi Daniil, I'd like to ask about the possibility of adding gridpanel (or the entire form with gridpanel) to dynamically created tab. Gridpanel is created using aspx mark up language. Tabs are created as follows:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack && !X.IsAjaxRequest)
{
// Get tabs for current report
System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection(aSecureWEBGlobals.GetConnectionString("asa"));
String strUsrId = (String)Session["UsrId"];
int intReportId = 1; // Priste brat z parametru volani Page
String strSqlCommand = "asg_GetReportSelectTabsToReport '" + strUsrId + "', " + intReportId + ", " + Session["LanguageId"].ToString();
SqlCommand myCommand = new SqlCommand(strSqlCommand, myConnection);
SqlDataReader myReader = default(SqlDataReader);
myConnection.Open();
myReader = myCommand.ExecuteReader();
// For every record create appropriate tab and grid with multiple select column
while (myReader.Read())
{
Int32 strTabID = myReader.GetInt32(0);
String strTabName = myReader.GetString(1);
String strTabTitle = myReader.GetString(2);
CreateTab(tpReportSelectTabs, strTabName, strTabTitle);
}
tpReportSelectTabs.ActiveTabIndex = 1;
}
}
private void CreateTab(TabPanel theTabPanel, String strTabName, String strTabTitle)
{
Ext.Net.Panel tab = new Ext.Net.Panel();
tab.ID = strTabName;
tab.Title = strTabTitle;
tab.Closable = false;
theTabPanel.Add(tab);
}
Empty tabpanel is:<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:TabPanel ID="tpReportSelectTabs" runat="server" Border="true" Height="600">
</ext:TabPanel>
</form>
</body>
Another question, if is it possible, where I should place aspx code with predefined gridpanel. Or for this purpose I should create whole gridapanel also dynamically in code behind (or JS) ? Thanks. ASAPCH
Last edited by Daniil; Dec 12, 2012 at 12:27 PM.
Reason: [CLOSED]