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

radgrid won't autoupdate

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
adrian
Top achievements
Rank 1
adrian asked on 05 Jul 2010, 06:52 PM

Hi,

I have 3 radtabs each one containing a radgrid. In the first tab you have all the to-be-classify registers, there can only be two types of registers ( A and R). So for example if you mark 10 registers on the first radgrid and classify them, the first radgrid rebinds (using the needDataSource event) and everything is fine, but if I change tab and look at any of the two other radgrids neither will be updated. I have to refresh the page if I want to see the changes.

In my code in the NeedDataSource event setting the DataSource for the 3 radgrids but only seems to be working for the selected radgrid (because if I change the classification from A to R in the second radgrid I wont see the registers that does not belong to this radgrid anymore but I don't see the changes on the R radgrid)

here is my code (I dont use any AjaxManager, all is being done only by Postbacks) 

Protected Sub setStatus(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridClientes.ItemCommand  
 
        If e.CommandName = "rejectStatus" Or e.CommandName = "approveStatus" Then  
            Dim item As Telerik.Web.UI.GridEditableItem = DirectCast(e.Item, Telerik.Web.UI.GridEditableItem)  
            Dim newStatus As String = "0"  
 
            If e.CommandName = "approveStatus" Then  
                newStatus = "A"  
            ElseIf e.CommandName = "rejectStatus" Then  
                newStatus = "R"  
            End If  
 
            updateRecord(item, newStatus)  
            Me.RadGrid1.Rebind()  
 
        End If  
    End Sub 

 Protected Sub RadGrid_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource, RadGridA.NeedDataSource, RadGridR.NeedDataSource  
        Dim ws As New webService  
 
        RadGrid1.DataSource = wsNC.fillStatus("0")  
        RadGridA.DataSource = wsNC.fillStatus("A")  
        RadGridR.DataSource = wsNC.fillStatus("R")  
 
    End Sub 

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 08 Jul 2010, 07:37 AM
Hi Adrian,

You should explicitly call Rebind to all three grids. Setting the DataSource property in such way is not suffusion to rebuild other grid controls. Also you should consider using sperate NeedDataSource handlers too.

Best wishes,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
adrian
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or