Dear All,
I have a simple and strange situation here.
Issue #1:
======
Working Scenario:
I have a usercontrols with a panelbar on it, I placed RadGrid control as a item templet then I assign a SqlDatasource to that grid DatasourceID, when I run the app. everything was good as expected.
NonWorking scenario:
I remove the SqlDatasource from the grid property and I use the NeedDataSource event where I create the SqlDatasource and assign it to the grid DataSourceID property , "no records found"
I make an alternative for this which is, I define the SqlDatasource declaratively on the usercontrols and then assign it's ID to RadGrid with no luck.
What is the problem here.
Here is my code:
Issue #2:
The panelBar has two or more panelbar the panelbar property expand mode is Single and the first item is expand by default.
But the panel is not collapsing or closing at all, it is always expanded for all child items ...
here is the .aspx syntax:
Hope that you can help me getting through...
Thanks and best regards,
Waleed
I have a simple and strange situation here.
Issue #1:
======
Working Scenario:
I have a usercontrols with a panelbar on it, I placed RadGrid control as a item templet then I assign a SqlDatasource to that grid DatasourceID, when I run the app. everything was good as expected.
NonWorking scenario:
I remove the SqlDatasource from the grid property and I use the NeedDataSource event where I create the SqlDatasource and assign it to the grid DataSourceID property , "no records found"
I make an alternative for this which is, I define the SqlDatasource declaratively on the usercontrols and then assign it's ID to RadGrid with no luck.
What is the problem here.
Here is my code:
protected void NewsGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
{ |
SqlDataSource1.Select(DataSourceSelectArguments.Empty); |
(source as RadGrid).DataSourceID = SqlDataSource1.ID; |
/* |
// Read connection from web.config |
ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"]; |
try |
{ |
// pass the values read to the datasource |
SqlDataSource sqlsource = new SqlDataSource(); |
sqlsource.ConnectionString = settings.ConnectionString; |
sqlsource.ProviderName = settings.ProviderName; |
sqlsource.SelectCommand = "SELECT ID, Link, Location, TimeCaptured, Brief, SmallImage FROM NewsSnap"; |
sqlsource.Select(DataSourceSelectArguments.Empty); |
(source as RadGrid).DataSourceID = sqlsource.ID; |
} |
catch(Exception ex) |
{ |
// swallow for now |
} |
*/ |
Issue #2:
The panelBar has two or more panelbar the panelbar property expand mode is Single and the first item is expand by default.
But the panel is not collapsing or closing at all, it is always expanded for all child items ...
here is the .aspx syntax:
<telerik:RadPanelBar ID="NewsPanel" runat="server" Width="100%" SkinID="PanelBar" ExpandMode="SingleExpandedItem"> | |
<CollapseAnimation Duration="100" Type="InSine" /> | |
<ExpandAnimation Duration="100" Type="outsine" /> | |
<Items> | |
<telerik:RadPanelItem Value="PanelItemGrid" Text="Root RadPanelItem1" runat="server" PostBack="False" Expanded="true"> | |
<ItemTemplate> | |
<telerik:RadGrid ID="NewsGrid" runat="server" SkinID="Grid" Width="100%" AllowPaging="True" AllowSorting="True" GridLines="None" OnNeedDataSource="NewsGrid_NeedDataSource" ShowFooter="True" ShowStatusBar="True"> | |
<MasterTableView AutoGenerateColumns="False"> | |
<RowIndicatorColumn Visible="False"> | |
<HeaderStyle Width="20px" /> | |
</RowIndicatorColumn> | |
<ExpandCollapseColumn Resizable="False" Visible="False"> | |
<HeaderStyle Width="20px" /> | |
</ExpandCollapseColumn> | |
<EditFormSettings> | |
<PopUpSettings ScrollBars="None" /> | |
</EditFormSettings> | |
<PagerStyle Mode="NextPrevAndNumeric" /> | |
</MasterTableView> | |
<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"> | |
<Selecting AllowRowSelect="True" /> | |
<Scrolling AllowScroll="True" UseStaticHeaders="True" /> | |
</ClientSettings> | |
</telerik:RadGrid> | |
</ItemTemplate> | |
</telerik:RadPanelItem> | |
<telerik:RadPanelItem Value="PanelItem2" Text="Root RadPanelItem2" runat="server" PostBack="False" Expanded="false"> | |
<ItemTemplate> | |
<asp:Button runat="server" ID="button1" /> | |
</ItemTemplate> | |
</telerik:RadPanelItem> | |
</Items> | |
</telerik:RadPanelBar> |
Hope that you can help me getting through...
Thanks and best regards,
Waleed