all groups > dotnet windows forms > february 2004 >
You're in the

dotnet windows forms

group:

newbee question


Re: newbee question Darrin J Olson
2/14/2004 7:43:41 PM
dotnet windows forms:
Try using 'ColumnName' instead of 'Caption'.

-Darrin


[quoted text, click to view]

newbee question EMW
2/14/2004 9:43:23 PM
I have a dataset containing 1 table with 1 column and I want to put the
values of each row in a combobox.

I've tried this:

Me.cbSitenummers.DataSource = dsShow.Tables(0)
Me.cbSitenummers.DisplayMember = dsShow.Tables(0).Columns(0).Caption
Me.cbSitenummers.ValueMember = dsShow.Tables(0).Columns(0).Caption

But the combobox remains empty and DataSource = nothing.

I know the dataset is filled, because the DisplayMember and ValueMember
properties are set to the rigth column name.
What am I doing wrong?

rg,
Eric

Re: newbee question chris
2/15/2004 11:10:37 AM
[quoted text, click to view]

Hi -

I use the following to fill a CheckedListBox control:

<note>"ds" is a DataSet the has been filled already</note>

for(int i = 0; i < ds.Tables[0].Rows.Count; i++){
//add items unchecked
this.checkedListBoxName.Items.Add(ds.Tables[0].Rows[i][0], false);
AddThis Social Bookmark Button