Yet another problem with DevExpress AspxGridView :)
The context:
One Page
In the Page, a custom control
In the custom Control, a AspxDropDown
The AspxDropDown, has a DropDownWindowTemplate
In the DropDownItemTemplate, I add a GridView and a paging/sorting/filtering enabled ObjectDataSource
When handling the Selecting event of the ObjectDataSource, I should set filter parameters for the datasource. There filter parameters should come from the FilterRow of the AspxGridView (preferably using the AspxGriedView.FilterExpression property).
The problem: the AspxGriedView.FilterExpression property is not set to the proper values (set by the user).
Did anyone find a good implementation of what I'm trying to do here?
Thanks a bunch.
:)
I've finally managed to get around the problem.
Not a good solution, but, still, a way to work around it.
So.. The "solution" is to databind the grid on every AfterPerformCallback event.
As I've said, it's not a good solution.
The answer per DevExpress is that the correct FilterExpression is updated when it is databound.
They allege that in BeforePerformDataSelect, you will see the correct value.
I have 1 grid that is hooked up to a SqlDataSource that is correctly doing this, and another that is not... So you're mileage may vary.
My second grid wasn't obeying this principal, so I integrated the other guy's concept rebinding in AfterPerformCallback(). The trick is to prevent double querying. This code also demonstrates how to hijack devexpress to build your own SQL. Obviously, this is from my working project, so use your imagination on functions that I have that you don't...
Here is the relevant html and code:
And here's the event handler for BeforePerformDataSelect:
private bool _DataBindingCompleted = false;