This is a migrated thread and some comments may be shown as answers.
RadGrid with tabStrip and Multipage
6 Answers 106 Views
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 02 Dec 2010, 10:31 AM
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.

6 Answers, 1 is accepted

Sort by
0
Rabeek Ahamed
Top achievements
Rank 1
answered on 02 Dec 2010, 01:33 PM

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

0
Ryan
Top achievements
Rank 1
answered on 02 Dec 2010, 07:52 PM
Thank you Gopinath, I will give it a try and post back my findings.

Thank you for your reply.
0
Ryan
Top achievements
Rank 1
answered on 06 Dec 2010, 01:37 PM
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
0
Ryan
Top achievements
Rank 1
answered on 07 Dec 2010, 06:47 AM
I've tested this using a normal web project and it works fine. It seems to be a problem on DotNetNuke.
0
Halil
Top achievements
Rank 1
answered on 14 Apr 2011, 10:14 PM
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
0
Helen
Telerik team
answered on 19 Apr 2011, 02:55 PM
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.

Asked by
Ryan
Top achievements
Rank 1
Answers by
Rabeek Ahamed
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Halil
Top achievements
Rank 1
Helen
Telerik team
Share this question
or