Newbie Kam

I want to use a checkedlistbox for users to check which record they want to select.
Can I show the full detail of record(serveral fields) instead of a single field


Re: Windows Forms Data Controls and Databinding display member of checkedlistbox

Zhi-Xin Ye - MSFT

Why not using a DataGridView with a datagridviewCheckBoxColumn instead




Re: Windows Forms Data Controls and Databinding display member of checkedlistbox

Newbie Kam

I want a check box at the first column for user to check it, state the record is selected,
there isn't any field for this check box to store the value in my database, the check box is
only for me to know which record(s) I'll need to save.
can datagridviewCheckBoxColumn do the same thing Or it is only one of the boolean display styles
Thank You




Re: Windows Forms Data Controls and Databinding display member of checkedlistbox

Zhi-Xin Ye - MSFT

Of cource the DataGridViewCheckBoxColumn can do the thing you want:

this.dataGridView1.Columns.Insert(0,new DataGridViewCheckBoxColumn());

This statement insert a DataGridViewCheckBoxColumn at the first column, it's just a checkbox column without any relation with your datasource if you do not set the DataPropertyName property of this column.

Regards,

Ye






Re: Windows Forms Data Controls and Databinding display member of checkedlistbox

Newbie Kam

That's what I want !! Thank You !!



Re: Windows Forms Data Controls and Databinding display member of checkedlistbox

NixonX

I think using a datagrid view is overkill if all you want to do is have a bound checkedlist box

Although it does not come up in the intellisense the following seems to work fine for me

Me.ChListGroups.DataSource = ds.Tables("Groups")

Me.ChListGroups.DisplayMember = "GroupName"

Me.ChListGroups.ValueMember = "id"