In my code, i want to add many items in radlistview and then save to sql server table in windows forms app. Here below is my code, but this code isnt working as radlistview does not contain definition for text
The ones i have lebelled in green color.
Note: This code normally works with normal windows list view control, but i want to use radlistview to implement the same.
if(ListView1.Items.Count == 0) { ListViewItem lst = new ListViewItem(txtCustomer.Text); lst.SubItems.Add(txtPhone.Text); lst.SubItems.Add(txtAddress.Text); lst.SubItems.Add(txtLoadNo.Text); lst.SubItems.Add(txtDriver.Text); lst.SubItems.Add(txtDriverPhone.Text); lst.SubItems.Add(txtHauler.Text); lst.SubItems.Add(txtPlateNo.Text); lst.SubItems.Add(txtProduct.Text); lst.SubItems.Add(txtDescription.Text); lst.SubItems.Add(txtQty.Text); lst.SubItems.Add(txtDate.Text); ListView1.Items.Add(lst); txtProduct.Text = ""; txtDescription.Text = ""; txtQty.Text = ""; return; } for(int j = 0; j <= ListView1.Items.Count - 1; j++) { if(ListView1.Items[j].SubItems[1].Text == txtCustomer.Text) { ListView1.Items[j].SubItems[1].Text = txtCustomer.Text; ListView1.Items[j].SubItems[2].Text = txtPhone.Text; ListView1.Items[j].SubItems[3].Text = txtAddress.Text; ListView1.Items[j].SubItems[4].Text = txtLoadNo.Text; ListView1.Items[j].SubItems[5].Text = txtDriver.Text; ListView1.Items[j].SubItems[6].Text = txtDriverPhone.Text; ListView1.Items[j].SubItems[7].Text = txtHauler.Text; ListView1.Items[j].SubItems[8].Text = txtPlateNo.Text; ListView1.Items[j].SubItems[9].Text = txtProduct.Text; ListView1.Items[j].SubItems[10].Text = txtDescription.Text; ListView1.Items[j].SubItems[11].Text = txtQty.Text; ListView1.Items[j].SubItems[12].Text = txtDate.Text; txtProduct.Text = ""; txtDescription.Text = ""; txtQty.Text = ""; return; } } ListViewItem lst1 = new ListViewItem(txtCustomer.Text); lst1.SubItems.Add(txtPhone.Text); lst1.SubItems.Add(txtAddress.Text); lst1.SubItems.Add(txtLoadNo.Text); lst1.SubItems.Add(txtDriver.Text); lst1.SubItems.Add(txtDriverPhone.Text); lst1.SubItems.Add(txtHauler.Text); lst1.SubItems.Add(txtPlateNo.Text); lst1.SubItems.Add(txtProduct.Text); lst1.SubItems.Add(txtDescription.Text); lst1.SubItems.Add(txtQty.Text); lst1.SubItems.Add(txtDate.Text); ListView1.Items.Add(lst1); txtProduct.Text = ""; txtDescription.Text = ""; txtQty.Text = ""; } catch(Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }