Hi Hrvoje,
I feel something is missing from your question.
In any case, the ListBox will be filled with DataRowViews, so simply go through all DataRowViews in the ListBox.Items collection and if the row qualifies, check the appropriate ListBox item
for(int i = 0; i < listBox1.Items.Count; i++)
{
DataRowView d = (DataRowView)listBox1.Items[i];
if(d["Column1"].ToString() == "SomeValue")
listBox1.SetItemChecked(i, true);
}
Note that you cannot do this in the constructor in the parent control (form) as SetItemChecked will be ignored. You can however do it in the Form's Load event.
On Thu, 19 May 2005 13:09:40 +0200, Hrvoje Voda <hr*********@luatech.com> wrote:
I fill a checked listbox with name from dataset.
I would like to go through that names and if I find the same name in list,
then that line should be checked.
How?
Hrcko
--
Happy coding!
Morten Wennevik [C# MVP]