This is a migrated thread and some comments may be shown as answers.

RadClientDataSource with ObjectDataSource in Web User Control

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RBarnes
Top achievements
Rank 1
RBarnes asked on 03 Oct 2016, 04:23 PM

 

Case 1)

If I place the below grid on a aspx page, the grid data is loaded client side and paging and sorting appear to be working as expected.

Case 2)

However, if I put the below grid on a web User Control, then place the control on an aspx page, paging and sorting do not work, the page number will change, but the data isn't refreshed in the grid, also if you click a heading to sort, the sort direction icon is shown, but the grid data does not refresh.

Case 3) (this is my end goal)

If you put the below grid in a ContentTemplate of a Menuitem, sort or paging does not work, and the page numbers won't change when changing pages, and the item count isn't correct.  (this is my end goal).  if I use server side binding, needdatasource everything works fine, but I'm really trying to get client side binding to avoid postbacks.  No editing of data, just view only.

 

Also, the template column that is commented out, throws an error when the page first loads, as it's binding to an empty datasource is my guess, says fph_Private isn't part of the DataSource.

 

 

 

 
<telerik:RadGrid ID="rgRecent1" runat="server" ClientDataSourceID="RadClientDataSource2"  AllowPaging="true" AllowSorting="true" PageSize="5">
                           <MasterTableView >
                              <Columns>
                                <%--  <telerik:GridTemplateColumn>
                                       <ItemTemplate>
                                           <asp:Image ID="imgShared" runat="server" ImageUrl="~/Images/Shared.png" Visible='<%# IIf(CType(Eval("fph_Private"), Boolean), 0, 1)%>' ToolTip="Shared" BorderWidth="0" Width="16px" />
                                       </ItemTemplate>
                                       <HeaderStyle HorizontalAlign="Left" Width="20px" />
                                       <ItemStyle HorizontalAlign="Left" Width="20px" />
                                   </telerik:GridTemplateColumn>--%>
                                   <telerik:GridBoundColumn UniqueName="pt_Type" DataField="pt_Type" HeaderText="<br />Type">
                                       <HeaderStyle HorizontalAlign="Left" Width="75px" />
                                       <ItemStyle HorizontalAlign="Left" Width="75px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="ItemsCount" DataField="ItemsCount" HeaderText="Items<br />Count">
                                       <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                       <ItemStyle HorizontalAlign="Left" Width="50px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="rm_RepNumber" DataField="rm_RepNumber" HeaderText="<br />Rep NO">
                                       <HeaderStyle HorizontalAlign="Left" Width="75px" />
                                       <ItemStyle HorizontalAlign="Left" Width="75px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="ot_Abbreviation" DataField="ot_Abbreviation" HeaderText="Lead<br />Time">
                                       <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                       <ItemStyle HorizontalAlign="Left" Width="50px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="fph_ProjectNumber" DataField="fph_ProjectNumber" HeaderText="<br />Project NBR">
                                       <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                       <ItemStyle HorizontalAlign="Left" Width="100px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="fph_ProjectName" DataField="fph_ProjectName" HeaderText="<br />Project Name">
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="LastFirstMiddle" DataField="LastFirstMiddle" HeaderText="<br />Initiator">
                                       <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                       <ItemStyle HorizontalAlign="Left" Width="200px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn UniqueName="fpr_AccessDate" DataField="fpr_AccessDate" DataFormatString="{0: MM/dd/yyyy hh:mm tt}" HeaderText="<br />Last Access Date">
                                       <HeaderStyle HorizontalAlign="Left" Width="125px" />
                                       <ItemStyle HorizontalAlign="Left" Width="125px" />
                                   </telerik:GridBoundColumn>
                               </Columns>
                           </MasterTableView>  
                               <ClientSettings>
                                   <DataBinding ShowEmptyRowsOnLoad="false" ></DataBinding>
                               </ClientSettings>
                               <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced"  />
                       </telerik:RadGrid>
 
                        <telerik:RadClientDataSource ID="RadClientDataSource2" runat="server" AllowPaging="true" PageSize="5" >
                           <DataSource>
                               <DataSourceControlSettings DataSourceID="ObjectDataSource_FPHR"  />
                           </DataSource>
                       </telerik:RadClientDataSource>
   <asp:ObjectDataSource  ID="ObjectDataSource_FPHR" runat="server" SelectMethod="GetFieldProjectRecent" TypeName="AppClassObjects.FieldProjectHeaderRecent" >
       <SelectParameters>
           <asp:SessionParameter Name="u_UsersID" DefaultValue="32" SessionField="UserID" Type="Int32" />
       </SelectParameters>
 
   </asp:ObjectDataSource>

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 06 Oct 2016, 10:23 AM
Hello,

Currently there are known issues when binding the RadClientDataSource to ObjectDataSource. We are working to resolve them as soon as possible.
Integration with other datasource controls (SqlDataSource, EntityDataSource) should work as expected.

Regards,
Marin
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
RBarnes
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or