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

[Solved] Rebind a child grid programatically!

2 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ciaran
Top achievements
Rank 1
Ciaran asked on 05 Oct 2009, 09:44 AM
I'm using the 3 tier heirarchichal demo

based on a user click in a checkbox on my page, I want to filter the most inner grid specific to the user on the page

Protected Sub CheckBox_CheckedChanged(ByVal sender As ObjectByVal e As System.EventArgs) 
 
        Dim whereclause As New StringBuilder 
        If CheckBox.Checked = True Then 
            whereclause.Append(" where PersonId = " + Session("PersonnelID").ToString + ""
        Else 
        End If 
 
        Dim selectclause As New StringBuilder("SELECT * FROM [Stuff]"
        Me.SqlDataSource3.SelectCommand = selectclause.ToString & whereclause.ToString 
        Me.SqlDataSource3.Select(New System.Web.UI.DataSourceSelectArguments) 
 
        Radgrid1.Rebind 
 
    End Sub 

Right now my code here is doubling the ammount of info in the grid rather than filtering it, what am I doing wrong?

any help would be appreciated

2 Answers, 1 is accepted

Sort by
0
Ciaran
Top achievements
Rank 1
answered on 06 Oct 2009, 09:13 AM

Any ideas here guys ?

 

any links or comments would be appreciated

0
Yavor
Telerik team
answered on 07 Oct 2009, 12:55 PM
Hello Ciaran,

One possible option in this case would be to set a filter expression for the GridTableView in question.
The following article contains additional information on how to reference a particular table view in the grid, at any level:

http://www.telerik.com/help/aspnet-ajax/grdtraversingdetailtablesitemsingrid.html

I hope this information helps.

Regards,
Yavor
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.
Tags
Grid
Asked by
Ciaran
Top achievements
Rank 1
Answers by
Ciaran
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or