Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to delete the similar item existing in both ListBox and TextBox by clicking a Button....

Using the Coding of C# Web Application......



For Example

ListBox Have = 1,2,13,4,5,16
TextBox Have = 1,13,34,78

I Want to remove the similar items exist both in ListBox and TextBox(1,13) from the ListBox after clicking a click of Button but TextBox may content all the items.
Posted
Updated 20-Dec-13 4:59am
v3
Comments
CHill60 20-Dec-13 10:51am    
You have our permission to do so.

Seriously though ... what have you tried? Use the Improve question link to post what you have tried so far and explain what your problem is
Sergey Alexandrovich Kryukov 20-Dec-13 10:59am    
What have you tried so far?
—SA
Member 9975733 20-Dec-13 11:00am    
I did not code just think the concept..... pl help in coding part
Sergey Alexandrovich Kryukov 20-Dec-13 11:21am    
Too bad... you need to do some coding part... what concept? Just do it. Or do not.
—SA
nuke_infer 20-Dec-13 11:11am    
my answer is down voted can you please tell me why ?

you can check the what are values in in list box get the values into array or index value and check the text box values are equels if yes delete it.you can use if else or arrays also.


thank you
 
Share this answer
 
C#
for (int i = 0; i < LB_Selective.Items.Count; i++)
        {
            for (int j = 0; j < LB_TotalIEs.Items.Count; j++)
            {
                if (LB_TotalIEs.Items.Equals(LB_Selective.Items))
                {
                    Response.Write("Hello");
                }
                else
                {
                    LB_TotalIEs.Items.Remove(LB_Selective.Items.ToString());

                }
            }
        }


I delete the similar items from 2 list box 

Correct the coding
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900