RadGrid with tabStrip and Multipage

7 posts, 0 answers
  1. Ryan
    Ryan avatar
    22 posts
    Member since:
    Oct 2010

    Posted 02 Dec 2010 Link to this post

    Good Day/Evening,

    I'm having some problems with the setting the datasource of 3 radgrid controls each in it's own RadPageView in the Multipage for a tabstrip.

    E.G

    RadGridUsers
    Column 1 Column 2 Column 3 SelectButton

    TAB 1 | TAB 2 | TAB 3

    MULTIPAGE
    ----------------
    RADGrid1
    ----------------
    RADGrid2
    ----------------
    RADGrid3
    ----------------

    Now what I'm doing is when I get a SelectedIndexChanged event from RadGridUsers, i want to set the RadGrid1,RadGrid2 and RadGrid3's datasource to Nothing (Null in C#) before I update the grids with new data. The problem I'm having is that the Grids Row Count of RadGrid1, RadGrid2 and RadGrid3 is still greater than 0 even after I set the datasource to Nothing.

    Private Sub RadGridUsers_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGridUsers.SelectedIndexChanged
     
    'Clear all Grids of any previous account's data
    RADGrid1.DataSource = Nothing
    RADGrid1.DataBind()
    RADGrid2.DataSource = Nothing
    RADGrid2.DataBind()
    RADGrid3.DataSource = Nothing
    RADGrid3.DataBind()
     
    Select Case TabStrip.SelectedTab.Text
    Case "TAB 1"
         RADGrid1.Datasource = GetProfile
         RADGrid1.DataBind()
         Exit Select
    Case "TAB 2"
         RADGrid2.Datasource = GetAddressDetails
         RADGrid1.DataBind()
         Exit Select
    Case "TAB 3"
         RADGrid3.Datasource = GetOrderHistory
         RADGrid1.DataBind()
         Exit Select
    End Select
     
    End Sub

    After I set all the RadGrid's Datasource to nothing and then only update the selected tabs RadGrid, I want the user to selecte another TAB (e.g TAB 3) and what I do then is check if the TAB3's RADGrid has any Items by doing this

    Private Sub TabStrip_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles TabStrip.TabClick
     
     Select Case e.Tab.Text
            Case "TAB1"
                If Not RadGrid1.Items.Count > 0 Then
                     RadGrid1.Datasource = GetProfile
                End If
            Case "TAB2"
                If Not RadGrid2.Items.Count > 0 Then
                     RadGrid2.Datasource = GetAddressDetails
                End If
            Case "TAB3"
                If Not RadGrid3.Items.Count > 0 Then
                     RadGrid3.Datasource = GetOrderHistory
                End If
     End Select
    End Sub

    My Problem is that the item count is always greater than 0 even after I've set the Datasource to Nothing and then did a RadGrid.DataBind.

    Your help would be much appreicated.
  2. Rabeek Ahamed
    Rabeek Ahamed avatar
    20 posts
    Member since:
    Sep 2012

    Posted 02 Dec 2010 Link to this post

    Hi Ryan,

    Have you tried using yourDataGrid.Rebind() method? It might solve your problem. If it does not then try this:
    Add this section on top of your rad grid:

    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

                <AjaxSettings>

                      <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

                        <UpdatedControls>

                            <telerik:AjaxUpdatedControl ControlID="radGridAlerts" />

                        </UpdatedControls>

                    </telerik:AjaxSetting>

                    <telerik:AjaxSetting AjaxControlID="radGridAlerts">

                        <UpdatedControls>

                            <telerik:AjaxUpdatedControl ControlID="radGridAlerts" />

                        </UpdatedControls>

                    </telerik:AjaxSetting>

                </AjaxSettings>

        </telerik:RadAjaxManager>

        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />

     [Note: You have to write event handlers in code behind]

     On each and every datasource change Rebind using javascript:

    $find(radGridAlertClientID).ajaxRequest("Rebind");

     Regards,
    Bharath

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ryan
    Ryan avatar
    22 posts
    Member since:
    Oct 2010

    Posted 02 Dec 2010 Link to this post

    Thank you Gopinath, I will give it a try and post back my findings.

    Thank you for your reply.
  5. Ryan
    Ryan avatar
    22 posts
    Member since:
    Oct 2010

    Posted 06 Dec 2010 Link to this post

    Hi,

    Do I have to use the RadAjaxManager? Also, I've been trying to figure out how to do this with the javascript you sent me, I'm still learning how to use the clientside functions etc. Could someone please assist me with a small code sample in achieving what I was trying to do.

    Thank you
  6. Ryan
    Ryan avatar
    22 posts
    Member since:
    Oct 2010

    Posted 07 Dec 2010 Link to this post

    I've tested this using a normal web project and it works fine. It seems to be a problem on DotNetNuke.
  7. Halil
    Halil avatar
    1 posts
    Member since:
    Mar 2011

    Posted 14 Apr 2011 Link to this post

    I use ajax, however, I get empty(blank)page if I use nextPage method in radgrid which is component of pageview in multipage. My troubles are emerged while using them in datasource.

    Thanks in Advance
  8. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 19 Apr 2011 Link to this post

    Hello Halil,

    Could you please open a support ticket and send us a sample project which demonstrates the issue to examine it locally?

    Regards,
    Helen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017