You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ValueMember is the name of the property in the data source that provides the value for the items.
The DisplayMember is the name of the property in the data source that provides the value used to dispay the items.
If you use "IsChecked" as the name of the ValueMember and your data source has a property IsChecked, it will simply bind the value to that property. It is not related to the checked state of an item. Items do not have a checked state since their type is entirely up to your application. That's the standard implementation in WinForms.
There would have to be a third binding property, something like CheckStateMember. It can be an enhancement for when we add binding to the ListView and possibly the TreeView.
One way to do this would be override RefreshItems() and in there loop over the items:
for (int i = 0; i < this.Items.Count; i++)
{
this.SetItemChecked(i, ((dynamic)this.Items[i]).Checked);
}
It obviously depends on your binding source and your classes in the app.
Activity
itg-assistant commentedon Jun 12, 2026
Luca answered 2017-03-21 20:40:54 UTC
The ValueMember is the name of the property in the data source that provides the value for the items.
The DisplayMember is the name of the property in the data source that provides the value used to dispay the items.
If you use "IsChecked" as the name of the ValueMember and your data source has a property IsChecked, it will simply bind the value to that property. It is not related to the checked state of an item. Items do not have a checked state since their type is entirely up to your application. That's the standard implementation in WinForms.
There would have to be a third binding property, something like CheckStateMember. It can be an enhancement for when we add binding to the ListView and possibly the TreeView.
One way to do this would be override RefreshItems() and in there loop over the items:
for (int i = 0; i < this.Items.Count; i++)
{
this.SetItemChecked(i, ((dynamic)this.Items[i]).Checked);
}
It obviously depends on your binding source and your classes in the app.
HTH
Best,
Luca