views:

517

answers:

2

I'm trying to use a DevExpress ASPxGridView to display some data. I need to allow my users to filter on a particular column, and I'd like to let them filter between two dates.

I know this is possible with the use of the FilterBar, but I'd like to try and do it in the actual filter row (the row that appears underneath the header), possibly as two date select boxes, (a from, to combo).

Any ideas how to modify the FilterRow would be useful,

Thanks

A: 

Create a second column with the same date. You can then use the original column as a from column by using a "greater than" filter. The second column can be a to column by having a "less than" filter. You can then hide the data in the second column column by adding a blank DataItemTemplate to the column. It's a bit clumsey but might do what you want.
Have a look at this post on custom row filters from the devexpress community, it suggests a possible work around.

macleojw
+1  A: 

Just an updated for anyone who may have the same question in the future:

Figured out to do it:

On your DevExpress ASPxGridView, add an event method on the "AutoFilterCellEditorInitialize", and intercept the creation here.

You can then add your additional controls into the filter row by doing a simple check of the column; For Example:

protected void gridView_AutoFilterCellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
{
    if (e.Column.Caption.Equals("FieldName"))
    {
        e.Editor.Controls.Add( new ASPxDateEdit() );
    }
}

Hope this helps anyone with a similar problem!

Irfy