5 Answers, 1 is accepted
0
Hi Alvin,
In case that you want to check ListView item, you should set the ListViewDataItem CheckState property to On:
If this is not the case, then please describe your case in greater detail.
I hope this helps.
All the best,
Peter
the Telerik team
Thank you for writing.
As far as I understand, you want to check the RadCheckBoxElement. To achieve this, you can use the following code:
radCheckBoxElement1.ToggleState = Telerik.WinControls.Enumerations.ToggleState.
On
In case that you want to check ListView item, you should set the ListViewDataItem CheckState property to On:
radListView1.Items[2].CheckState = Telerik.WinControls.Enumerations.ToggleState.On
If this is not the case, then please describe your case in greater detail.
I hope this helps.
All the best,
Peter
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0

Alvin
Top achievements
Rank 1
answered on 15 Dec 2011, 06:47 AM
Thanks for replying.
I think I need to provide more information. What I want to do is to create custom items in RadListView from a list of objects.
After I create the MyCustomVisualItem class (icon view), I get my custom items created successfully and displayed in RadListView. A checkbox is showed with each custom item listed in RadListView. But how can I checked the checkbox programmatically right after the custom item iscreated.
The code like following does not work
Me.RadListView1.DataSource = myObjectList
For i = 0 To Me.RadListView1.Items.Count - 1
Me.RadListView1.Items(i).CheckState = Telerik.WinControls.Enumerations.ToggleState.On
Next
Another problem is every time I update the myObjectList and run Me.RadListView1.DataSource = myObjectList to re-create the custom items in RadListView again, the checkboxes that have been checked with cursor previously will be unchecked automatically. But CheckState of these checkboxes are still "On". Any solution for that?
Thanks
I think I need to provide more information. What I want to do is to create custom items in RadListView from a list of objects.
After I create the MyCustomVisualItem class (icon view), I get my custom items created successfully and displayed in RadListView. A checkbox is showed with each custom item listed in RadListView. But how can I checked the checkbox programmatically right after the custom item iscreated.
The code like following does not work
Me.RadListView1.DataSource = myObjectList
For i = 0 To Me.RadListView1.Items.Count - 1
Me.RadListView1.Items(i).CheckState = Telerik.WinControls.Enumerations.ToggleState.On
Next
Another problem is every time I update the myObjectList and run Me.RadListView1.DataSource = myObjectList to re-create the custom items in RadListView again, the checkboxes that have been checked with cursor previously will be unchecked automatically. But CheckState of these checkboxes are still "On". Any solution for that?
Thanks
0
Hi Alvin,
The approach you have described in your last post should work correctly. This makes me think that there might be something wrong with your custom visual items. Therefore, I would kindly ask you to open a new support ticket and send me a sample project which demonstrates this scenario. This will let me investigate it and provide you a solution. Alternatively, you can post your full source code here on the forums.
Generally, as I mentioned in a previous thread of yours, RadListView uses virtualization mechanism which means that the visual items stand for displaying the logical ones. At run time, each visual item is being detached and attached to different logical items so the check state should be kept in the data items.
I am looking forward to hearing from you.
Greetings,
Ivan Todorov
the Telerik team
The approach you have described in your last post should work correctly. This makes me think that there might be something wrong with your custom visual items. Therefore, I would kindly ask you to open a new support ticket and send me a sample project which demonstrates this scenario. This will let me investigate it and provide you a solution. Alternatively, you can post your full source code here on the forums.
Generally, as I mentioned in a previous thread of yours, RadListView uses virtualization mechanism which means that the visual items stand for displaying the logical ones. At run time, each visual item is being detached and attached to different logical items so the check state should be kept in the data items.
I am looking forward to hearing from you.
Greetings,
Ivan Todorov
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0

Alvin
Top achievements
Rank 1
answered on 20 Dec 2011, 03:06 AM
Thanks for reply.
You are right, I double-checked my custom visual item class and found "MyBase.SynchronizeProperties()" was commented out in function SynchronizeProperties(). It works fine after I changed it back.
Thanks
You are right, I double-checked my custom visual item class and found "MyBase.SynchronizeProperties()" was commented out in function SynchronizeProperties(). It works fine after I changed it back.
Thanks
0
Hello Alvin,
I am glad that you have managed to sort this out.
Should you need future help, do not hesitate to contact us.
Kind regards,
Ivan Todorov
the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
I am glad that you have managed to sort this out.
Should you need future help, do not hesitate to contact us.
Kind regards,
Ivan Todorov
the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.