Checkbox to datagrid...

  • Thread starter wink martindale
  • Start date
W

wink martindale

Hello All,

I am certain this has been asked before, but here goes:

How do I add a checkbox to a datagrid that is not related to a field
in the database? This checkbox will enable the user to create a custom
list by selecting the records they want to view.

Any help would be much apprectiated,


TIA,

WInk
 
M

Mike W

Assuming this is a Windows Forms app.
Have you tried using the DataGridColumnStyle Collection Editor?
You can add a DataGridBoolColumn that should work as you've described.

-m
 
C

Cor Ligthert [MVP]

Wink,

You have to add a column in your datatable. The datagrid won't work without
that.
(Because it is not in your database is it not updated before you think
that).

\\\
dt.Columns.Add("WInk", GetType(System.Boolean))
///

I hope this helps,

Cor
 
M

Mike W

Cor is correct (no surprise). You need to add a column for this to work.
If you try to add a column with the DataGridColumStyle Collection Editor
without populating "Mapping Name", the new column won't display.

-m
 
W

wink martindale

Worked like a champ! Thanks for the help!

Wink
Wink,

You have to add a column in your datatable. The datagrid won't work without
that.
(Because it is not in your database is it not updated before you think
that).

\\\
dt.Columns.Add("WInk", GetType(System.Boolean))
///

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top