Hello everybody,
I have a problem using the element visibilty property on ElementVisibility.Collapsed on the radgridview RowFormatting event.
When i try to put the row visibility to ElementVisibility.Collapsed, there is a strange behavior, the rows are not correctly displayed.
Here is a sample that reproduces the problem :
Imports
Telerik.WinControls.UI
Public
Class
RadForm1
Private
_Liste
As
New
List(Of MyClass1)
Public
Sub
New
()
' Cet appel est requis par le concepteur.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
_Liste.Add(
New
MyClass1
With
{.Prop1 = 10, .Prop2 =
"AAA"
& .Prop1})
_Liste.Add(
New
MyClass1
With
{.Prop1 = 10, .Prop2 =
"BBB"
& .Prop1})
_Liste.Add(
New
MyClass1
With
{.Prop1 = 10, .Prop2 =
"CCC"
& .Prop1})
_Liste.Add(
New
MyClass1
With
{.Prop1 = 100, .Prop2 =
"DDD"
& .Prop1})
_Liste.Add(
New
MyClass1
With
{.Prop1 = 100, .Prop2 =
"FFF"
& .Prop1})
_Liste.Add(
New
MyClass1
With
{.Prop1 = 1, .Prop2 =
"QQQ"
& .Prop1})
_Liste.Add(
New
MyClass1
With
{.Prop1 = 1, .Prop2 =
"SSS"
& .Prop1})
RadGridView1.DataSource = _Liste
End
Sub
Private
Sub
RadGridView1_RowFormatting(sender
As
Object
, e
As
RowFormattingEventArgs)
Handles
RadGridView1.RowFormatting
If
DirectCast
(e.RowElement.RowInfo.DataBoundItem, MyClass1).Prop1 = 10
Then
e.RowElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
Else
e.RowElement.Visibility = Telerik.WinControls.ElementVisibility.Visible
End
If
End
Sub
Private
Class
MyClass1
Public
Property
Prop1
As
Integer
Public
Property
Prop2
As
String
End
Class
End
Class
Maybe i'm missing something, but when i replace Telerik.WinControls.ElementVisibility.Collapsed by Telerik.WinControls.ElementVisibility.Hidden, i have the expected behavior (except that the rows are not collapsed).
Thanks in advance for your answers, and sorry for my aweful english ... I'm french.
I'm using Windows 7 64 bits, with 2016.3.1024.40 version of radcontrols, and .Net Framework v4