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

BindingNavigator + Filter

5 Answers 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael W. Welling
Top achievements
Rank 1
Michael W. Welling asked on 06 May 2008, 06:36 AM
Hello,
I use a DatabindingSource, BindingNavigator and r.a.d. GridView. When filtering the data in GridView, the BindingNavigator show still the recordcount all over the datasource within filter. Which property of GridView give back the current filter string?

I use version 2007 Q3

regards
Michael

5 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 06 May 2008, 12:13 PM
Hi Michael,

In the versions before Q1 2008, the filter expression is accessible through:
 
string filterString = this.radGridView1.MasterGridViewInfo.FilterExpression; 

In Q1 2008 the filter string is accessible through:
 
string fitlerString = this.radGridView1.MasterGridViewTemplate.FilterExpressions.ToString(); 

 
Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael W. Welling
Top achievements
Rank 1
answered on 06 May 2008, 12:49 PM
I'm. sorry, but exactly this property (.MasterGridViewInfo.FilterExpression) give back an empty string ... (on FilterChanged-Event) ...
Any other idea?
0
Dwight
Telerik team
answered on 06 May 2008, 02:30 PM
Hello Michael,

Fortunately, this issue, which appears in Q3 2007, and has been already addressed in the recently released Q1 2008. I recommend migrating your project to the Q1 2008 version of our controls, which offer a greatly improved (in terms of performance and capability) RadGridView, and a variety of improvements across the whole component suite.

If you decide to stick with Q3 2007, however, I propose using the following work-around (using reflection):

private static MethodInfo buildFilterExpression = typeof(GridViewInfo).GetMethod("BuildFilterExpression", BindingFlags.Instance | BindingFlags.NonPublic); 
 
private static string ObtainFilterExpression(RadGridView grid) 
    if (buildFilterExpression == null || grid == null || grid.MasterGridViewInfo == null)  
        return string.Empty; 
 
    return (string)buildFilterExpression.Invoke(grid.MasterGridViewInfo, null); 
 

If you have any additional questions, please contact me.

Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael W. Welling
Top achievements
Rank 1
answered on 06 May 2008, 03:15 PM
I don't want believe that! 2 Weeks ago, I upated to 2008 Q1. 2 Days I find all bugs of this release. One day I restore my solution to 2007 Q3 SP1. The documentation is very vacuous ... And now, you say to me, I should migrating to 2008 Q1. Step by step, I can't be bothered ...

Sorry, but I could only earn my money by programming and not by try and error.

Please, give me the workaround (your last post) as Visual Basic.Net code.
0
Kiril
Telerik team
answered on 06 May 2008, 04:05 PM
Hi Michael W. Welling,

Thank you for getting back to me.

I apologize for the inconvenience this issue has caused you. I looked at your other posts, and noticed you've also experienced the RadGridView Visual Studio design time crash. We identified the issue causing the crash last week, and have been since offering a custom build addressing the issue. We have sent you the link to this custom build in the other support ticket you have open today.

I highly encourage you to download this custom build and use it. It will also address the issue you've open this support ticket for, and you will not have to use the workaround anymore. Let us know whether the issue persists.

Kind regards,
Kiril
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Michael W. Welling
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Michael W. Welling
Top achievements
Rank 1
Kiril
Telerik team
Share this question
or