473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DropDownList(c# window forms)-control the The Repetetions

hai

i strucked with a proble in dis topic .i created the five dropdown list having the some same fields.
my problem is if i select one item in one dropdown that item wont repet the reminig dropdowns vice versa

pls plse help me dis
regards,
vikramk
Aug 8 '07 #1
3 1026
prabunewindia
199 100+
hi friend,
what u tried so far?
just write the code in dropdownlist_selectedindexchanged event
if the select item is exist in others then just delete that
Prabu

hai

i strucked with a proble in dis topic .i created the five dropdown list having the some same fields.
my problem is if i select one item in one dropdown that item wont repet the reminig dropdowns vice versa

pls plse help me dis
regards,
vikramk1410@gmail.com
Aug 8 '07 #2
hai i write tat codin chanced event only

private void ddlFirst_SelectedIndexChanged(object sender, EventArgs e)
{
BindFirstDDL();
if (ddlFirst.SelectedIndex > 0)//0 && ddlSecond.SelectedIndex > 0 && ddlThree.SelectedIndex > 0 && ddlFour.SelectedIndex > 0 && ddlFive.SelectedIndex > 0 && ddlSix.SelectedIndex > 0)
{

ddlSecond.Items.Remove(ddlFirst.SelectedItem);
ddlThree.Items.Remove(ddlFirst.SelectedItem);
ddlFour.Items.Remove(ddlFirst.SelectedItem);
ddlFive.Items.Remove(ddlFirst.SelectedItem);

}
}
Aug 8 '07 #3
prabunewindia
199 100+
hi friend,
do u want the selected item in ine ddl not to be selected in other ddls or not to be in other ddls?

and to remove the item follow the below code

ddlSecond.Items.FindByText(ddlFirst.SelectedItem.T ext).Remove();

if any error occur then give me the error also

try and reply
Prabu



hai i write tat codin chanced event only

private void ddlFirst_SelectedIndexChanged(object sender, EventArgs e)
{
BindFirstDDL();
if (ddlFirst.SelectedIndex > 0)//0 && ddlSecond.SelectedIndex > 0 && ddlThree.SelectedIndex > 0 && ddlFour.SelectedIndex > 0 && ddlFive.SelectedIndex > 0 && ddlSix.SelectedIndex > 0)
{

ddlSecond.Items.Remove(ddlFirst.SelectedItem);
ddlThree.Items.Remove(ddlFirst.SelectedItem);
ddlFour.Items.Remove(ddlFirst.SelectedItem);
ddlFive.Items.Remove(ddlFirst.SelectedItem);

}
}
Aug 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ritskits | last post by:
I have the dropdownlist that is populated when the form is loaded. I have the button that opens search child window using the modalwindowdialog and it returns the value that I want to add to the...
2
by: NewToDotNet | last post by:
Hi, I am very new to ASP.NET and web programming in general. I have one issue. I have a Datagrid object with Edit template. In one Datagrid row, I have 1 DropdownList, 1 textbox and 1 readonly...
4
by: Keith | last post by:
I have this simple scenario. -------- Choose an item ->dropdownlist-> or <a>Create a new item</a> -------- When someone decides to click on the create a new item link, it takes them to a...
7
by: Andy | last post by:
I have been struggling with this for a while, and have seen lots of related postings, but nothing (as far as I can see) that answers this directly. Im using vb dotnet and have an aspx that has a...
6
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
0
by: ritskits | last post by:
I have the dropdownlist that is populated when the form is loaded. I have the button that opens search child window using the modalwindowdialog and it returns the value that I want to add to the...
2
by: Marc Robitaille | last post by:
Hello, I set the DataSource property of a DropDownList to as DataSet that is filled from a SQLDataAdapter. The AutoPostBack property of that DropDownList is set to True. When the...
1
by: Kevin Blount | last post by:
I have a test script right now that I'm fighting with. The idea is to "simply" have an aspx page with 3 panels, to show 3 "different" forms and then a 4th panel to show the results of processing...
2
by: Kevin Blount | last post by:
I have a test script right now that I'm fighting with. The idea is to "simply" have an aspx page with 3 panels, to show 3 "different" forms and then a 4th panel to show the results of processing...
6
by: w1688 | last post by:
Hi All, I had asp page using Visual studio 2005 to develop. I had a dropdownlist box with more than hundred items list. I am looking a function which allow user to type on dropdownlist box and the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.