C# 从checkedlistbox获取CheckedItems

C# 从checkedlistbox获取CheckedItems,c#,.net,C#,.net,我选中了绑定到数据源的列表框,如下所示: chListBox.DataSource = dsContacts.Tables["Contacts"]; chListBox.DisplayMember = "FullName"; chListBox.ValueMember = "ContactNumber"; 我想通过以下代码获取checkeditems集合,但“无法将”System.Data.DataRowView“类型的对象强制转换为”System.String“

我选中了绑定到数据源的列表框,如下所示:

     chListBox.DataSource = dsContacts.Tables["Contacts"];
     chListBox.DisplayMember = "FullName";
     chListBox.ValueMember = "ContactNumber";
我想通过以下代码获取checkeditems集合,但“无法将”System.Data.DataRowView“类型的对象强制转换为”System.String“类型时出错:

        int i = 0;
        foreach (string row in chListBox.CheckedItems)
        {
            phoneNumbers[i] = row.ToString();
            i++;
        }

有什么问题吗?

CheckedItems的内容不是字符串

    int i = 0; 
    foreach (DataRowView rowView in chListBox.CheckedItems) 
    { 
        phoneNumbers[i] = rowView["ContactNumber"]; 
        i++; 
    } 

CheckedItems的内容不是字符串

    int i = 0; 
    foreach (DataRowView rowView in chListBox.CheckedItems) 
    { 
        phoneNumbers[i] = rowView["ContactNumber"]; 
        i++; 
    }