is there any difference in controls between windows and web applications?? i ddnt find drop down control in windows application??
about windows and web application controls..
Hi frnds,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
iswarya chandranPosted Jul 29, 2013, 4:52 AM
thank you frnds.. nw its working... thnk u murali, sanjeeb, Iftikar..
Iftikar HussainPosted Jul 29, 2013, 4:48 AM
You need to set DataSource as DataTable, not the dataadpter
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select name, age from tblinfo", con);
DataTable dt= new DataTable(); da.Fill(dt);
DataRow dr;
dr= dt.NewRow();
dr.ItemArray= new object[] {0, "-- Select an item--"};
dt.Rows.InsertAt(dr,0);
comboBox1.DataSource = dt;
Regards,
Iftikar
iswarya chandranPosted Jul 29, 2013, 4:34 AM
yeah i tried that too..
but there is an error
" Complex DataBinding accepts as a data source either an IList or an IListSource"
my code is:
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select name, age from tblinfo", con);
DataTable dt= new DataTable(); da.Fill(dt);
DataRow dr;
dr= dt.NewRow();
dr.ItemArray= new object[] {0, "-- Select an item--"};
dt.Rows.InsertAt(dr,0);
comboBox1.DataSource = da;
Sanjeeb LenkaPosted Jul 29, 2013, 4:32 AM
but it is different form asp.net dropdown.
it works like both textbox and dropdown. you can enter your value in this but in asp.net only selection.
its a combination of textbox and dropdown in windows form.
Posted Jul 29, 2013, 4:23 AM
You need to use ComboBox control.
iswarya chandranPosted Jul 29, 2013, 4:21 AM
Posted Jul 29, 2013, 4:06 AM
iswarya chandranPosted Jul 29, 2013, 4:02 AM
Posted Jul 29, 2013, 3:30 AM
Exactly what are you trying do here ?
In which control you're trying to implement this?
Drag-and-Drop Functionality in Windows Forms
iswarya chandranPosted Jul 29, 2013, 3:19 AM
bt what u saying about drag and drop i cnt get it??
can u explain??
Posted Jul 29, 2013, 3:08 AM
Web controls:
Works based on the browser + HTTP Request context etc.
Windows controls
Depends on the OS
Runs on top of Windows Forms.
When you say, drag & drop, in which control you're trying this?
http://msdn.microsoft.com/en-us/library/ms171546.aspx