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

[Solved] Unable to set the filter expression for self referential grid.

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
giridhar
Top achievements
Rank 1
giridhar asked on 30 Mar 2009, 02:09 PM
Hi,
  I have a dataset which gives the list of id's and parent id's I am unable to set the FilterExpression
as follows, do let me know if there is some other syntax to be used.
string ID = 2839;
selfReferentialGrid.MasterTableView.FilterExpression = @"PrntID=" + ID;

Error is thrown on selfReferentialGrid.DataBind().

Would there be any problem if PrntID has null values.

Thanks and regards,
Giridhar.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Apr 2009, 08:55 AM
Hi giridhar,

One similar case is demonstrated in the following example. More specifically, the code:

 public void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadGrid1.MasterTableView.FilterExpression = "ParentID = 0";
            }
        }


Additionally, if you are using the 3.5 version of the controls, you can disable the linq expressions (EnableLinqExpressions=false), since the linq syntax is different.
I hope this helps.

Sincerely yours,
Yavor
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
giridhar
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or