This is a migrated thread and some comments may be shown as answers.

How to remove Exits items in RadListbox

0 Answers 228 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
AL MUBARAK
Top achievements
Rank 2
AL MUBARAK asked on 02 Sep 2014, 04:01 PM
Dear All,

   I'm very new guy here. and I had two RadListBoxItems in my aspx page. ListUserCols and ListAllCols.  and while I'm loaded some of the values through DB in ListUserCols for manualy selected items. and then I loaded all of my 50 items in ListAllCols listbox.!

  Now, I need to check from Second Listbox items(ListUserCols) not exist in First Listbox items. Please help me to find out resolved that issue.. I'm searched google in many time. No results are found. Moreover, i didn't select any Items in listbox, all loaded from DB.

Sample code:

                     DataSet dsAttributes = new DataSet();
                      foreach (DataRow dr in dsAttributes.Tables[0].Rows)
                        {
                            lstUserColumns.Items.Add(new RadListBoxItem(dr["Column_Desc"].ToString()));
                        }

                      

                        foreach (RadListBoxItem selectedItem in lstUserColumns.Items)
                        {
                            //lstAllColumns.Items.Remove(new RadListBoxItem(selectedItem.Value));
                            RadListBoxItem item = lstAllColumns.FindItemByText(selectedItem.Text);
                            item.Remove();
                        }                       
                    }

No answers yet. Maybe you can help?

Tags
ListBox
Asked by
AL MUBARAK
Top achievements
Rank 2
Share this question
or