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

export whole radGrid with column filters

3 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 26 Sep 2011, 05:18 PM
i have a radGrid with ColumnFilters that allows paging as well. we've been doing exports to excel from an external button that's simply been running the same thing as the need datasource. however, the only thing i cannot figure out how to do is "capture" any column filtering. it seems like i have to use an external radFilter apart from the grid to do this. is there a way to get what someone has filtered to on the column? most of our grids use the external radFilter & this export works just fine, i can tap into those filters. just can't figure out if it's possible to do the same with the column filters. thanks for any help on this.
rik

3 Answers, 1 is accepted

Sort by
0
rik butcher
Top achievements
Rank 1
answered on 26 Sep 2011, 07:08 PM
i did find i can use the needdatasource to get "sort of" what im looking for:

txtFilter.Value = RevenueRadGrid.MasterTableView.FilterExpression ;
however for ,say three columns filtered, i get this:

(it["PROFITCENTERCODE"].ToString().ToUpper().StartsWith("0708".ToUpper()))
AND (it["COMPANYNAME"].ToString().ToUpper().StartsWith("apache%".ToUpper()))
AND (it["INVOICENUMBER"].ToString().ToUpper().StartsWith("1564633".ToUpper()))


really what i need is this:

and PROFITCENTERCODE StartsWith('0708%')
AND (COMPANYNAME StartsWith('apache%')
AND (INVOICENUMBER StartsWith('1564633%')
so, other than just "hacking" my way thru this string is there anything else i can use?
thx
rik


0
Tsvetina
Telerik team
answered on 27 Sep 2011, 12:07 PM
Hello Rik,

If you need the FilterExpression in Transact SQL syntax, set the grid property to EnableLinqExpressions="false". Otherwise, the filter expression will be generated as a Dynamic LINQ query.

Best wishes,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
rik butcher
Top achievements
Rank 1
answered on 27 Sep 2011, 06:19 PM
that worked great. still leaves brackets "[ ]" but i just do a replace on those and i'm in business.
thanks again for your help
rik
Tags
Grid
Asked by
rik butcher
Top achievements
Rank 1
Answers by
rik butcher
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or