I have a nested radgrid which does not page. All it does is collapse the grid when I try. I based it off of the grid/hierarchy with Templates demo from the telerik demo site and the code behind that it shows does not seem to be anything special but everything that I have tried has not worked. The nest radgrid that I am referencing is the one called RepresentedGrid.
If I remove the datasourceid and rely only on the needdatasource function being explicitly set up in the grid then I end up with an empty grid.
Part of the problem is the fact that even if I try to set up a page index changed function, the grid is never found so I end up with errors about instance not being set to an object.
If I remove the datasourceid and rely only on the needdatasource function being explicitly set up in the grid then I end up with an empty grid.
Part of the problem is the fact that even if I try to set up a page index changed function, the grid is never found so I end up with errors about instance not being set to an object.
</telerik:RadAjaxManager>
<telerik:RadGrid ID=
"RadGrid1"
runat=
"server"
AllowPaging=
"True"
AllowSorting=
"True"
CellSpacing=
"0"
GridLines=
"None"
PageSize=
"20"
ShowFooter=
"True"
Width=
"979px"
AutoGenerateColumns=
"false"
>
<MasterTableView DataKeyNames=
"Fullname,FileAs, Email, Department, Company, BusinessPhone, BusinessFax, Website, Categories, OtherNotes, LinkedDocs, Represented"
PageSize=
"20"
>
<NestedViewTemplate>
<asp:Panel runat=
"server"
ID=
"InnerContainer"
Visible=
"false"
BackColor=
"AliceBlue"
>
<telerik:RadTabStrip runat=
"server"
ID=
"TabStip1"
MultiPageID=
"Multipage1"
SelectedIndex=
"0"
>
<Tabs>
<telerik:RadTab runat=
"server"
Text=
"Contact Information"
PageViewID=
"PageView1"
>
</telerik:RadTab>
<telerik:RadTab runat=
"server"
Text=
"Distributors/Distributing"
PageViewID=
"PageView2"
>
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage runat=
"server"
ID=
"Multipage1"
SelectedIndex=
"0"
RenderSelectedPageOnly=
"false"
>
<telerik:RadPageView runat=
"server"
ID=
"PageView1"
>
<table >
<tr><td>Business Fax:</td><td><%# Eval(
"BusinessFax"
)%></td></tr>
<tr><td>Business Address:</td><td><%# addressFormat(Eval(
"BusinessAddress"
))%></td></tr>
<tr><td>Attached Documents:</td><td><%# documentShow(Eval(
"LinkedDocs"
))%></td></tr>
<%--<tr><td>Representing/Represented By:</td><td><%# cleanRepresented (Eval(
"Represented"
))%></td></tr>--%>
<tr><td>Other Notes:</td><td><%# Eval(
"OtherNotes"
)%></td></tr>
</table>
</telerik:RadPageView>
<telerik:RadPageView runat=
"server"
ID=
"RadPageView2"
>
<asp:SqlDataSource ID=
"SqlDataSource3"
ConnectionString=
"<%$ ConnectionStrings:SterlingConnection %>"
ProviderName=
"System.Data.SqlClient"
SelectCommand=
'<%# vendorCrossReference(Eval("VendorID"))%>'
runat=
"server"
>
<telerik:RadGrid runat=
"server"
ID=
"RepresentedGrid"
DataSourceID=
"SqlDataSource3"
ShowFooter=
"true"
AllowPaging=
"True"
EnableAJAX=
"True"
AllowSorting=
"true"
>
<PagerStyle Mode=
"Slider"
></PagerStyle>
<MasterTableView ShowHeader=
"true"
AutoGenerateColumns=
"False"
AllowPaging=
"true"
DataKeyNames=
"VendorID, Fullname,FileAs, Email, Department, Company, BusinessPhone, BusinessFax, Website, Categories, OtherNotes, LinkedDocs, Represented"
PageSize=
"20"
>
<Columns>
<telerik:GridBoundColumn SortExpression =
"Company"
HeaderText=
"Company"
DataField =
"Company"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"Email"
HeaderText=
"Email"
DataField =
"Email"
AllowFiltering=
"false"
DataFormatString=
"<a href='mailto:{0}'>{0}</a>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"Website"
HeaderText=
"Website"
AllowFiltering=
"false"
DataField =
"Website"
DataFormatString=
"<a href='{0}' target='_blank'>{0}</a>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"BusinessPhone"
HeaderText=
"Business Phone"
AllowFiltering=
"false"
DataField =
"BusinessPhone"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"BusinessFax"
HeaderText=
"Business Fax"
DataField =
"BusinessFax"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"BusinessAddress"
HeaderText=
"Business Address"
DataField =
"BusinessAddress"
>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</telerik:RadPageView>
</telerik:RadMultiPage>
</asp:Panel>
</NestedViewTemplate>
<Columns>
<telerik:GridBoundColumn SortExpression =
"Company"
HeaderText=
"Company"
DataField =
"Company"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"Email"
HeaderText=
"Email"
DataField =
"Email"
AllowFiltering=
"false"
DataFormatString=
"<a href='mailto:{0}'>{0}</a>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"Website"
HeaderText=
"Website"
AllowFiltering=
"false"
DataField =
"Website"
DataFormatString=
"<a href='{0}' target='_blank'>{0}</a>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"BusinessPhone"
HeaderText=
"Business Phone"
AllowFiltering=
"false"
DataField =
"BusinessPhone"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression =
"Categories"
HeaderText=
"Categories"
DataField =
"Categories"
>
</telerik:GridBoundColumn>
</Columns>
Public
Sub
RepresentedGrid_NeedDataSource(
ByVal
source
As
Object
,
ByVal
e
As
GridNeedDataSourceEventArgs)
If
Not
e.IsFromDetailTable
Then
Dim
dataSource
As
SqlDataSource = RadGrid1.MasterTableView.Items(0).ChildItem.FindControl(
"SqlDataSource3"
)
Dim
RepresentedGrid
As
RadGrid
RepresentedGrid = RadGrid1.MasterTableView.Items(0).ChildItem.FindControl(
"RepresentedGrid"
)
RepresentedGrid.DataSource = dataSource
End
If
End
Sub
Protected
Sub
RadGrid1_ItemCreated(
ByVal
sender
As
Object
,
ByVal
e
As
GridItemEventArgs)
Handles
RadGrid1.ItemCreated
If
TypeOf
e.Item
Is
GridNestedViewItem
Then
Dim
typeContent =
DirectCast
(e.Item.FindControl(
"RepresentedGrid"
), RadGrid)
AddHandler
typeContent.NeedDataSource,
AddressOf
Me
.RepresentedGrid_NeedDataSource
End
If
End
Sub