I try to hide a row that have a specific status, When I do like the code below. the row is not shown, but there is space left "blank" in the grid where the row should be. I also tested with Height=0
Any suggestions?
/Ken
private
void
radGrid_RowLoaded(
object
sender, RowLoadedEventArgs e)
{
GridViewRow row = e.Row
as
GridViewRow;
if
(row !=
null
)
{
MyClass _MyClass = row.DataContext
as
MyClass;
if
(row !=
null
&& _MyClass !=
null
)
{
row.IsExpandable = _MyClass.Category.Equals(5);
}
else
{
row.IsExpandable =
false
;
}
if
(_MyClass.MediaCategory.Equals(5) && _MyClass.Status.Equals(-1))
{
row.Visibility = System.Windows.Visibility.Collapsed;
}
}
}
Any suggestions?
/Ken
5 Answers, 1 is accepted
0
Hello Kennet,
Kind regards,
Yavor Georgiev
the Telerik team
In this scenario it is best to use filtering. Here's how you can do what you want in XAML:
<
telerik:RadGridView
...>
<
telerik:RadGridView.FilterDescriptors
>
<
telerik:CompositeFilterDescriptor
LogicalOperator
=
"Or"
>
<
telerik:CompositeFilterDescriptor.FilterDescriptors
>
<
telerik:FilterDescriptor
Member
=
"Status"
Operator
=
"IsNotEqualTo"
Value
=
"5"
/>
<
telerik:FilterDescriptor
Member
=
"Status"
Operator
=
"IsNotEqualTo"
Value
=
"-1"
/>
</
telerik:CompositeFilterDescriptor.FilterDescriptors
>
</
telerik:CompositeFilterDescriptor
>
</
telerik:RadGridView.FilterDescriptors
>
</
telerik:RadGridView
>
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Kennet
Top achievements
Rank 2
answered on 16 Jul 2010, 01:01 PM
That is not working for me, and I need to have "IsFilteringAllowed=False" on the RadGrid.
Is there any other way to do it? I prefere with C# code.
/Ken
Is there any other way to do it? I prefere with C# code.
/Ken
0
Hello Kennet,
Yavor Georgiev
the Telerik team
Unfortunately, you cannot modify the visibility of a GridViewRow, because that would seriously tamper with virtualziation.
The IsFilteringAllowed property controls whether users can filter the grid via the filtering icon in GridViewHeaderCell. The approach I have suggested still works with this property set to false.
Could you please send me your application so I can see why the filtering does not work?
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Kennet
Top achievements
Rank 2
answered on 16 Jul 2010, 01:20 PM
Hi Yavor,
Good to hear that filter works without flags visible in header.
I can't send you my project since it a part of a big project, I will try to take the time to make a mackup on just this function.
How Can I do the filtering by code?
/Ken
Good to hear that filter works without flags visible in header.
I can't send you my project since it a part of a big project, I will try to take the time to make a mackup on just this function.
How Can I do the filtering by code?
/Ken
0
Accepted
Hello Kennet,
You can learn more about programatic filtering here.
Sincerely yours,
Pavel Pavlov
the Telerik team
You can learn more about programatic filtering here.
Sincerely yours,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items