VB.net windows app questioins

  • Thread starter Thread starter c_shah
  • Start date Start date
C

c_shah

I am learning developing a windows form app using VB.net and have
couple of questions

(1)
I have a combo box in a form which is bound to a dataset, Is there any
easy way to add an item called "--select--" to the combo box

here is my code
combobox1.datasource = mydataset.tables(0)
combobox1.displaymember = "displaycolumn"
combobox1.valuemember = "mycolumn")

when i do

combobox1.items.insert(0,"--select--")

It is giving me an error cannot modify items collection when dataset
property is set

(2) I put a datetime picker control so when you select date it will
populate textbox control named date. Is there anyway do customize this
control so that instead of dropdown datetime picker it will display an
icon of calendar right next to this textbox. When user select an icon
it will pop up date picker calendar. (in the web applications some site
like expedia has this kind of functionality)

Thanks in advance
 
For the First question... yes you can do select.. add the item Select to
your DataRow in the table... more like

Dim drSel as DataRow
drSel = mydataset.tables(0).NewRow()
drSel.Item("ID") = 0;
drSel.Item("Desc") = "<Select>"
'.. other column values
mydataset.tables(0).Rows.Add(drSel)

Bind the DataSet here..


Second question. There are 3 party controls available to do this..., or you
could just add a button, Show a Pop-up in which you can display a calendar
control...

Vijay
 
Just google it, you will get plenty... or check the codeproject.com or
gotdotnet.com websites.. you might find sure one ...

VJ
 
Back
Top