C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Windows »

The first record of the Combobox should be blank at runtime


Posted Date: 07 Nov 2009      Posted By: SuganyaCMR      Member Level: Gold     Points: 1   Responses: 5



Hi,

I have combobox at windows application, In that i bind data to combobox
Eg:
iam binding roll no
1
2
3
like that while at runtime
i need a empty blank space first
then
1
2
3
i need it at runtime (Problem is data is binding to combobox properly, i need a empty blank record at first)
give me sample

Regards,
Suganya

In order to succeed, you must first be willing to fail!
Rate my post!.If u found useful





Responses

Author: Reach2Shaik    07 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

after binding data to combobox

write

Combobox.SelectedValue = -1;


Don't forget to rate this answer, if it is helpful...
Regards Shaik



Author: Deepika Haridas    07 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hello,

You can write

cmbxtestID.SelectedIndex = -1;




Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Author: Dharmaraj    07 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,
You can set the values to the

comboBox1.SelectedIndex=-1;
//or you can have like this
comboBox1.Text=""; // at the form load or the page load


Regards,
Dharma
Editor,Mentor,MVM
Try and fail but don't fail and try
Me and DNS



Author: Kirtan    08 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

You can not Add New Item to Bound Combobox.

but before Binding Combobox with DataTable Add one new Blank DataRow

in Datable to Solve the Problem

Kirtan Patel
-----------------------------------------------------
Master Of Computer Application(Sem-1)
Bachelore of Computer Application



Author: Selvam    14 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

hi,
in Form_load()
u can use

ComboBoxName.SelectedIndex=-1

and where ever u need to be empty comboBox u can use this code



Post Reply
You must Sign In to post a response.
Next : Adding datagridviewimagecouumn dynamically
Previous : Remeber me for Winforms application.
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use