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

Filter grid with checked listbox

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Botero
Top achievements
Rank 1
David Botero asked on 05 Apr 2010, 12:44 AM
Hello, I have a grid and a checked listbox, what I want to do is filter de grid by selecting/deselecting the listbox items, i had it working, but I don't know why it stopped working, this is the code:

private void fncGridData(){  
        try 
        { 
            DataView dvDataView=new DataView(); 
            dvDataView = ((DataTable)Cache["Materials"]).DefaultView; 
            if (lstSubcategories.CheckedItems.Count == lstSubcategories.Items.Count) 
            { 
                dvDataView.RowFilter = ""
            } 
            else if(lstSubcategories.CheckedItems.Count==0){ 
                dvDataView.RowFilter = "id_sub_category=-1"
            } 
            else { 
                dvDataView.RowFilter = "id_sub_category IN (" + fncQueryComplement() + ")"
            } 
            RadGrid1.DataSource = (DataTable)Cache["Materials"]; 
        } 
        finally 
        {     
            SqlConnection.Close(); 
        } 
    } 

This code was exceuted on the ItemCheck property of the listbox, but then I made some changes to other parts of the code and it stopped working, why is this?

Regards.


1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 08 Apr 2010, 06:54 AM
Hi David,

Based on the supplied information, it is hard to determine what is causing this unwanted behavior. To further track the issue, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior. We will debug it locally, and get back to you with more information on the matter.

Regards,
Yavor
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
David Botero
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or