Hello all,
I am having several problems trying to add panels to a tabstrip.
Configuration:
Telerik.Web.UI.dll 2008.2.1001.35
VS2008
ASP.NET 3.5
Scenario: I have a tabstrip that will have a panel bar in it, in each panel there will be a grid control. I am adding the panels and grids within a server event.
My aspx looks basically like:
...
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="radMP" SelectedIndex="0">
<Tabs>
<telerik:RadTab runat="server" Text="Identify">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="radMP" runat="server" CssClass="pageView" SelectedIndex="0">
<telerik:RadPageView ID="pvIdentify" runat="server" >
<telerik:RadPanelBar ID="pbIdentifyResults" runat="server" Skin="Vista" CssClass="panelBar" ExpandMode="FullExpandedItem"
EnableViewState="true">
<CollapseAnimation Duration="100" Type="None" />
<ExpandAnimation Duration="100" Type="None" />
</telerik:RadPanelBar>
</telerik:RadPageView>
</telerik:RadMultiPage>
...
My css:
...
.pageView
{
border: 1px solid #898c95;
overflow: visible;
}
.panelBar
{
width: 100%;
}
.indentifyGrid
{
padding: 0em 1em 1em 1em;
width: 100%;
overflow: scroll;
}
...
My code basically looks like:
private void Identify()
{
...
RadGrid rg = new RadGrid();
rg.ID = "identify" + l.Title;
rg.AllowPaging = false;
rg.AllowFilteringByColumn = true;
rg.AllowAutomaticDeletes = false;
rg.AllowAutomaticInserts = false;
rg.AllowAutomaticUpdates = false;
rg.AllowMultiRowEdit = false;
rg.Skin = Profile.GridSkin;
rg.CssClass = "indentifyGrid";
rg.AutoGenerateColumns = true;
GridHyperLinkColumn link = new GridHyperLinkColumn();
link.HeaderText = "View";
link.DataTextField = "extents";
link.DataTextFormatString = "<a href=\"#\" onclick=\"javascript:ViewTheme({0});return true;\">View On Map</a>";
link.Visible = true;
link.AllowFiltering = false;
link.SortExpression = "";
rg.Columns.Add(link);
rg.Columns[0].ItemStyle.Width = new Unit("7em");
SqlDataSource sds = Utilities.SpatialDataSource(sql);
sds.DataSourceMode = SqlDataSourceMode.DataReader;
sds.SelectCommandType = SqlDataSourceCommandType.Text;
rg.DataSource = sds;
rg.DataBind();
RadPanelItem panel = new RadPanelItem(l.Title);
panel.Attributes.Add("rowcnt", rg.Items.Count.ToString());
panel.Expanded = true;
RadPanelItem item = new RadPanelItem();
item.Expanded = true;
item.Value = l.Title;
item.Controls.Add(rg);
panel.Items.Add(item);
this.pbIdentifyResults.Items.Add(panel);
...
}
Now my list of problems:
Thanks in advance,
Lee
I am having several problems trying to add panels to a tabstrip.
Configuration:
Telerik.Web.UI.dll 2008.2.1001.35
VS2008
ASP.NET 3.5
Scenario: I have a tabstrip that will have a panel bar in it, in each panel there will be a grid control. I am adding the panels and grids within a server event.
My aspx looks basically like:
...
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="radMP" SelectedIndex="0">
<Tabs>
<telerik:RadTab runat="server" Text="Identify">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="radMP" runat="server" CssClass="pageView" SelectedIndex="0">
<telerik:RadPageView ID="pvIdentify" runat="server" >
<telerik:RadPanelBar ID="pbIdentifyResults" runat="server" Skin="Vista" CssClass="panelBar" ExpandMode="FullExpandedItem"
EnableViewState="true">
<CollapseAnimation Duration="100" Type="None" />
<ExpandAnimation Duration="100" Type="None" />
</telerik:RadPanelBar>
</telerik:RadPageView>
</telerik:RadMultiPage>
...
My css:
...
.pageView
{
border: 1px solid #898c95;
overflow: visible;
}
.panelBar
{
width: 100%;
}
.indentifyGrid
{
padding: 0em 1em 1em 1em;
width: 100%;
overflow: scroll;
}
...
My code basically looks like:
private void Identify()
{
...
RadGrid rg = new RadGrid();
rg.ID = "identify" + l.Title;
rg.AllowPaging = false;
rg.AllowFilteringByColumn = true;
rg.AllowAutomaticDeletes = false;
rg.AllowAutomaticInserts = false;
rg.AllowAutomaticUpdates = false;
rg.AllowMultiRowEdit = false;
rg.Skin = Profile.GridSkin;
rg.CssClass = "indentifyGrid";
rg.AutoGenerateColumns = true;
GridHyperLinkColumn link = new GridHyperLinkColumn();
link.HeaderText = "View";
link.DataTextField = "extents";
link.DataTextFormatString = "<a href=\"#\" onclick=\"javascript:ViewTheme({0});return true;\">View On Map</a>";
link.Visible = true;
link.AllowFiltering = false;
link.SortExpression = "";
rg.Columns.Add(link);
rg.Columns[0].ItemStyle.Width = new Unit("7em");
SqlDataSource sds = Utilities.SpatialDataSource(sql);
sds.DataSourceMode = SqlDataSourceMode.DataReader;
sds.SelectCommandType = SqlDataSourceCommandType.Text;
rg.DataSource = sds;
rg.DataBind();
RadPanelItem panel = new RadPanelItem(l.Title);
panel.Attributes.Add("rowcnt", rg.Items.Count.ToString());
panel.Expanded = true;
RadPanelItem item = new RadPanelItem();
item.Expanded = true;
item.Value = l.Title;
item.Controls.Add(rg);
panel.Items.Add(item);
this.pbIdentifyResults.Items.Add(panel);
...
}
Now my list of problems:
- I could not get the items to expand and collapse properly with adding the items directly to the panelbar. So I found this link: http://www.telerik.com/community/forums/thread/b311D-bgdgdd.aspx that told me to add a panel, then add another panel to that. The problem now is that I still can't get the panels to expand. I see them with the Expand\Collapse icon, but they won't do anything when I click on them. I have looked at the response on the page and the html is there, just that the panelbar is hiding it.
- This is really a styling issue that I think is only kind of related. When I was using just a single panel right on the panelbar, I could see my grid, but it extended off the end of the page while my panelbar was only 300px or so wide. What I really want is to have the panels extend all the way across the page (ie: width: 100%) and have the grid be contained within there. If the grid needs to extend past that, it should have scrollbars at the bottom. Can anyone tell me what I have wrong in my css that is causing the panelbar not to extend to the width of the page?
Thanks in advance,
Lee