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

Masterpage event and grid bind

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jean-Marc
Top achievements
Rank 1
Jean-Marc asked on 13 Oct 2011, 10:29 AM
Hi,
I have this scenario
an aspx page with masterpage. The masterpage has a combobox control, as that value changes an event is raised.
I catch it this way
   Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
       AddHandler Master.supplierChanged, AddressOf onSupplierChanged
   End Sub
 
Protected Sub onSupplierChanged()
       RadGridNMBacheche.Rebind()
   End Sub

and then on needdatasource fill the datasource with businness object
Protected Sub RadGridNMBacheche_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGridNMBacheche.NeedDataSource
        Try
 
            Dim NM As New NewsManager.CNewsForMyself(myConn)
            Dim myDataset As DataSet = NM.getNewsForMyself_asDataset(OrderMode)
 
            RadGridNMBacheche.DataSource = myDataset
        
        Catch ex As Exception
            Call LogManager.WriteToErrorLog(errorPath, ClassName, System.Reflection.MethodBase.GetCurrentMethod.Name.ToString(), ex, Err())
        End Try
    End Sub


So, as combobox value changes my grid changes as well (myconn changes), unless mydataset (the datasource) is nothing,
in this case grid does not refresh and still shows old records. ajax or not ajax is the same.

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 14 Oct 2011, 07:42 AM
Hello Jean-Marc,

Attached is a small sample that demonstrates how to achieve your scenario.

Hope it helps.

Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Jean-Marc
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or