tags:

views:

187

answers:

4

Hi all

I have a SPGridView that displays items from a list with filtering.

the list has some lookupfields. in my SPGridview the filter values of a lookupfield appear in this format:

{id};#{Value}

which makes the filter not work because it is expecting the value only without the {id};#

is there a way to display the filter values without the {id};# part ?

thanks

A: 

Up... I have this problem... help plz!

Gabriel Freire
A: 

When you generating columns for SPGridView, use SPBoundField, not BoundField.

Darky
A: 

I already tried that. I'm not talking about how it displays in the gridview, there it appear correctly. However, when I enable filtering, and try to filter on the column it displays with the "{id};#{value}" format.

For example, the grid shows "Database Manager" but the auto-filter shows "12#;Database Manager"

thx!

Gabriel Freire
A: 

Try setting the FilteredDataSourcePropertyFormat property to

"({1} LIKE '{0}') OR ({1} LIKE '{0};%') OR ({1} LIKE '%;#{0}') OR ({1} LIKE '%;#{0};%')"
JWL_