or
private
void
uxAssignedAt_VisualListItemFormatting(
object
sender, VisualItemFormattingEventArgs args)
{
var personne = args.VisualItem.Data.DataBoundItem
as
Personne;
// Reset default value
args.VisualItem.ResetValue(LightVisualElement.VisibilityProperty, ValueResetFlags.Local);
if
(personne !=
null
&& !personne.IndActive)
{
args.VisualItem.Visibility = ElementVisibility.Collapsed;
}
}
Imports
System.ComponentModel
Public
Class
Form1
Private
myList
As
BindingList(Of MyObject)
Private
Sub
Form1_Load(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Handles
Me
.Load
myList =
New
BindingList(Of MyObject)()
myList.Add(
New
MyObject(1,
"Outdoor"
))
myList.Add(
New
MyObject(2,
"Hardware"
))
myList.Add(
New
MyObject(3,
"Tools"
))
myList.Add(
New
MyObject(4,
"Books"
))
myList.Add(
New
MyObject(5,
"Appliances"
))
AddHandler
myList.ListChanged,
AddressOf
myList_ListChanged
RadGridView1.DataSource = myList
End
Sub
Sub
myList_ListChanged(
ByVal
sender
As
Object
,
ByVal
e
As
ListChangedEventArgs)
End
Sub
Private
Sub
RadButton1_Click_1(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
RadButton1.Click
myList.Add(
New
MyObject(6,
"Plants"
))
' DO NOT CHANGE SELECTION!
End
Sub
Public
Class
MyObject
Public
Sub
New
(
ByVal
myInt
As
Integer
,
ByVal
myString
As
String
)
_myInt = myInt
_myString = myString
End
Sub
Private
_myInt
As
Integer
Public
Property
MyInt()
As
Integer
Get
Return
_myInt
End
Get
Set
(
ByVal
value
As
Integer
)
_myInt = value
End
Set
End
Property
Private
_myString
As
String
Public
Property
MyString()
As
String
Get
Return
_myString
End
Get
Set
(
ByVal
value
As
String
)
_myString = value
End
Set
End
Property
End
Class
End
Class