Home All Groups Group Topic Archive Search About

VB.net windows app questioins

Author
15 Apr 2006 1:46 PM
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

Author
15 Apr 2006 5:29 PM
VJ
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


Show quoteHide quote
"c_shah" <shah.chi***@netzero.net> wrote in message
news:1145108813.146442.298190@j33g2000cwa.googlegroups.com...
>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
>
Author
15 Apr 2006 7:03 PM
c_shah
thank  you. any free third party calendar control?
Author
15 Apr 2006 8:31 PM
VJ
Just google it, you will get plenty... or check the codeproject.com or
gotdotnet.com websites.. you might find sure one ...

VJ

Show quoteHide quote
"c_shah" <shah.chi***@netzero.net> wrote in message
news:1145127789.054797.79060@g10g2000cwb.googlegroups.com...
> thank  you. any free third party calendar control?
>