I had a problem with radgrid navigation, I am binding a dataset to the grid from needdatasource event. When i use a simple sql statement to fill my dataset I am able to see the navigation bar (which has page size, next page, prev page options) but whenever I use a join statement to fill my datatset I am losing the navigation bar of the radgrid (i dont see the page size, next, prev options at the bottom).
Can anybody help me out from this issue.
Thanks,
Kevin
Can anybody help me out from this issue.
Thanks,
Kevin
3 Answers, 1 is accepted
0
Hi Kevin,
Could you please send the problematic page code? I will check it out and try finding what could have wrong there.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Could you please send the problematic page code? I will check it out and try finding what could have wrong there.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kevin
Top achievements
Rank 1
answered on 30 Sep 2009, 10:36 PM
Thanks for the reply Pavlina,
I am using master page
master page markup:
Markup for page2 where I have the radgrid:
code behind for needdatasource:
getMstrData():
instead of using join to get the master table data, I have tried using a simple sql statement select * from mstr_tb and I can see the pagination but when I tried to use the join, it is not displaying the pagination.
this is what i had
Thanks,
Kevin
I am using master page
master page markup:
| <%@ Master Language="VB" CodeFile="XXXNavigation.master.vb" Inherits="XXXNavigation" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>XXXXX</title> |
| <!--<script type="text/javascript"> |
| //This script is to prompt user before navigating away from the current tab |
| var isTabClicked = "false"; |
| function OnClientTabSelecting(sender, args) |
| { |
| if(isTabClicked == "false") |
| { |
| //cancel the action |
| args.set_cancel(true); |
| //get the tab which is clicked |
| var tab = args.get_tab(); |
| function CallBackFn(arg) |
| { |
| if(arg) |
| { |
| isTabClicked = "true"; |
| tab.click(); |
| } |
| } |
| //ask the user for confirmation |
| radconfirm("Any unsaved data will be lost by navigating away from this tab?",CallBackFn); |
| } |
| } |
| function OnClientTabSelected() |
| { |
| //reset the isTabClicked variable |
| isTabClicked = "false"; |
| } |
| </script>--> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="ScriptMgr1" runat="server" EnableTheming="True" AsyncPostBackTimeout ="360000"> |
| </telerik:RadScriptManager> |
| <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
| </telerik:RadWindowManager> |
| <div> |
| <telerik:RadTabStrip ID="RadTabStrip1" runat="server"><Tabs> |
| <telerik:RadTab runat="server" Text="tab1" NavigateUrl="~/page1.aspx"></telerik:RadTab> |
| <telerik:RadTab runat="server" Text="tab2" NavigateUrl="~/page2.aspx"></telerik:RadTab> |
| <telerik:RadTab runat="server" Text="tab3" NavigateUrl="~/page3.aspx"></telerik:RadTab> |
| <telerik:RadTab runat="server" Text="tab4" NavigateUrl="~/page4.aspx"></telerik:RadTab> |
| </Tabs> |
| </telerik:RadTabStrip> |
| <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"> |
| </asp:contentplaceholder> |
| </div> |
| </form> |
| </body> |
| </html> |
Markup for page2 where I have the radgrid:
| <%@ Page Language="VB" MasterPageFile="~/XXXNavigation.master" AutoEventWireup="false" CodeFile="page2.aspx.vb" Inherits="page2" title="Untitled Page" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" |
| Namespace="System.Web.UI" TagPrefix="asp" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> |
| <asp:Button ID="InsertRecord" runat="server" Text="Button" style="display:none;"/> |
| <asp:hiddenfield id="CmtsHdnFld" value="" runat="server"/> |
| <div> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function mngRequestStarted(ajaxManager, eventArgs) |
| { |
| if (eventArgs.get_eventTarget().indexOf("ExportToExcel") != -1) |
| eventArgs.set_enableAjax(false); |
| } |
| </script> |
| </telerik:RadCodeBlock> |
| <telerik:RadAjaxManager ID="RadAjaxMgr1" runat="server" ClientEvents-OnRequestStart="mngRequestStarted"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="radGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="radGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| <ClientEvents OnRequestStart="mngRequestStarted" /> |
| </telerik:RadAjaxManager> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" EnableSkinTransparency="false" runat="server" Width="500px" Height="500px" BackgroundPosition="Center" /> |
| <telerik:RadGrid ID="radGrid1" runat="server" Width="95%" |
| AutoGenerateColumns="False" PageSize="15" AllowSorting="True" AllowPaging="True" |
| AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" |
| ShowStatusBar="True" GridLines="None" OnDetailTableDataBind="radGrid1_DetailTableDataBind" AllowMultiRowSelection="True"> |
| <MasterTableView CommandItemDisplay="Bottom" DataKeyNames="ID" Width="100%" Name="MasterTable" |
| AllowMultiColumnSorting="True" EditMode="InPlace"> |
| <CommandItemTemplate> |
| <table> |
| <tr> |
| <td> |
| <asp:LinkButton ID="btnAdd" Text="<b>Click here to add a new record</b>" CommandName="InitInsert" Runat="server"></asp:LinkButton> |
| </td> |
| <td style="width:850px"> |
| </td> |
| <td> |
| <asp:LinkButton ID="btnSubmit" Text="<b>Click here to Submit</b>" CommandName="SubmitSelected" Runat="server"></asp:LinkButton> |
| </td> |
| </tr> |
| </table> |
| </CommandItemTemplate> |
| <DetailTables> |
| <telerik:GridTableView DataKeyNames="ID,ID" Width="100%" runat="server" AllowAutomaticDeletes="False" AllowAutomaticInserts="False" AllowAutomaticUpdates="False" GridLines="None" NoDetailRecordsText="No test values to display." AllowPaging="False"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="MSTR_ID" MasterKeyField="ID" /> |
| </ParentTableRelation> |
| <Columns> |
| <telerik:GridBoundColumn SortExpression="FLD_NME" HeaderText="FIELD" HeaderButtonType="TextButton" |
| DataField="FLD_NME" UniqueName="FLD_NME"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn SortExpression="T_DESCRIPTION" HeaderText="DESCRIPTION" HeaderButtonType="TextButton" |
| DataField="T_DESCRIPTION" UniqueName="T_DESCRIPTION"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn SortExpression="T_T1_VAL" HeaderText="TEST ONE" HeaderButtonType="TextButton" |
| DataField="T_T1_VAL" UniqueName="T_T1_VAL"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn SortExpression="T_T2_VAL" HeaderText="TEST TWO" HeaderButtonType="TextButton" |
| DataField="T_T2_VAL" UniqueName="T_T2_VAL"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn SortExpression="T_VALUE" HeaderText="VALUE" HeaderButtonType="TextButton" |
| DataField="T_VALUE" UniqueName="T_VALUE"> |
| </telerik:GridBoundColumn> |
| <telerik:GridCheckBoxColumn UniqueName="T_TO_AMR" HeaderText="AMR" DataField="T_TO_AMR"> |
| </telerik:GridCheckBoxColumn> |
| </Columns> |
| <CommandItemSettings AddNewRecordText="" RefreshText="" /> |
| </telerik:GridTableView> |
| </DetailTables> |
| <Columns> |
| <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton" |
| DataField="ID" UniqueName="ID" Visible="False"> |
| </telerik:GridBoundColumn> |
| <telerik:GridDropDownColumn UniqueName="WELL_ID" DataSourceID="sqlWellIdSource" |
| SortExpression="WELL_ID" ListTextField="ID" |
| ListValueField ="ID" HeaderText="WELL" DataField="WELL_ID"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridDropDownColumn UniqueName="CAISSON_ID" DataSourceID="sqlCasnIdSource" |
| SortExpression="CAISSON_ID" ListTextField="CAISSON" |
| ListValueField ="ID" HeaderText="CAISSON" DataField="CAISSON_ID" EnableEmptyListItem = "True"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridDateTimeColumn DataField="TEST_DATE" HeaderText="DATE" |
| UniqueName="TEST_DATE"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridDropDownColumn UniqueName="TST_TYP" DataSourceID="SqlChsnMthdSource" |
| SortExpression="TST_TYP" ListTextField="CHSN_MTHD" |
| ListValueField ="ID" HeaderText="TEST TYPE" DataField="TST_TYP"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridDateTimeColumn DataField="STRT_TME_TST1" HeaderText="TEST 1 STARTTIME" |
| UniqueName="STRT_TME_TST1" PickerType="DateTimePicker"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridDateTimeColumn DataField="END_TME_TST1" HeaderText="TEST 1 ENDTIME" |
| UniqueName="END_TME_TST1" PickerType="DateTimePicker"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridDateTimeColumn DataField="STRT_TME_TST2" HeaderText="TEST 2 STARTTIME" |
| UniqueName="STRT_TME_TST2" PickerType="DateTimePicker" MinDate="2009-01-09"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridDateTimeColumn DataField="END_TME_TST2" HeaderText="TEST 2 ENDTIME" |
| UniqueName="END_TME_TST2" PickerType="DateTimePicker" MinDate="2009-01-09"> |
| </telerik:GridDateTimeColumn> |
| <telerik:GridBoundColumn UniqueName="SUB_STATUS" HeaderText="STATUS" DataField="SUB_STATUS"> |
| </telerik:GridBoundColumn> |
| <telerik:GridEditCommandColumn /> |
| <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" |
| ConfirmText="Are you sure you want to delete this Well Test?"> |
| </telerik:GridButtonColumn> |
| <telerik:GridTemplateColumn HeaderText="Export To Excel" UniqueName="ExpToXls"> |
| <ItemTemplate> |
| <asp:LinkButton ID="ExportToExcel" CommandName="ExportToXLS" Text="Export To Excel" runat="server"></asp:LinkButton> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Submit" UniqueName="SubChkBox"> |
| <ItemTemplate> |
| <asp:CheckBox ID="SubmitChkBox" runat="server" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| <ExpandCollapseColumn Visible="True"> |
| </ExpandCollapseColumn> |
| <EditFormSettings> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| </EditFormSettings> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="sqlSource1" runat="server" ConnectionString="<%$ AppSettings:ConnectionString1 %>" ProviderName="System.Data.OracleClient" |
| SelectCommand="SELECT ID FROM SAMPLE_TB WHERE IS_ACTV = 'Y'ORDER BY ID ASC"></asp:SqlDataSource> |
| <asp:SqlDataSource ID="sqlSource2" runat="server" ConnectionString="<%$ AppSettings:ConnectionString1 %>" ProviderName="System.Data.OracleClient" |
| SelectCommand="SELECT ID, ITEM1 FROM SAMPLE2_TB WHERE IS_ACTV = 'Y'"></asp:SqlDataSource> |
| <asp:SqlDataSource ID="SqlSource3" runat="server" ConnectionString="<%$ AppSettings:ConnectionString1 %>" ProviderName="System.Data.OracleClient" |
| SelectCommand="SELECT ID, MTHD FROM SAMPLE3_TB WHERE IS_ACTV = 'Y'"></asp:SqlDataSource> |
| </div> |
| </asp:Content> |
code behind for needdatasource:
| Protected Sub radGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles radGrid1.NeedDataSource |
| Try |
| If Not e.IsFromDetailTable Then |
| radGrid1.DataSource = bm.getMstrData() |
| End If |
| Catch ex As Exception |
| Response.Write(ex.ToString) |
| End Try |
| End Sub |
getMstrData():
| Public Function getMstrData() As DataTable |
| Dim ds As New dataset |
| Dim sql As String = "SELECT * FROM MSTR_TB INNER JOIN " & _ |
| "SAMPLE1_TB ON MSTR_TB.ID = SAMPLE1_TB.ID WHERE SAMPLE1_TB.IS_ACTV = 'Y' ORDER BY SAMPLE1_ID ASC" |
| bizHelper.LoadData(ds, "MSTR_TB", sql) |
| Return ds.Tables("MSTR_TB") |
| End Function |
instead of using join to get the master table data, I have tried using a simple sql statement select * from mstr_tb and I can see the pagination but when I tried to use the join, it is not displaying the pagination.
this is what i had
Thanks,
Kevin
0
Hi Kevin,
I went through your code and it looks fine to me. However, I suggest that you isolate the issue into a runnable sample and send it through formal support ticket. Thus I could investigate it in depth and provide a proper solution for you?
Thank you for your cooperation in advance.
Regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I went through your code and it looks fine to me. However, I suggest that you isolate the issue into a runnable sample and send it through formal support ticket. Thus I could investigate it in depth and provide a proper solution for you?
Thank you for your cooperation in advance.
Regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.