470,636 Members | 1,420 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Datagrid Checkbox Column

im trying (unsucessfully) to add a checkbox column to my datagrid

i basically have a datagrid that im populating from a dataset

Me.DataGrid1.DataSource = ds.Tables(0)

the datagrid then has 5 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great

Thanks

Mike
Nov 20 '05 #1
17 7219
You need to add a TableStyle to the Grid, including the Columns you want.
Make the last Column you add to the style a DataGridCheckBoxColumn

/Lars
"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:Qp************@newsfe1-gui.server.ntli.net...
im trying (unsucessfully) to add a checkbox column to my datagrid

i basically have a datagrid that im populating from a dataset

Me.DataGrid1.DataSource = ds.Tables(0)

the datagrid then has 5 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great

Thanks

Mike

Nov 20 '05 #2
http://www.knowdotnet.com/articles/kdngrid.html

try this
"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:Qp************@newsfe1-gui.server.ntli.net...
im trying (unsucessfully) to add a checkbox column to my datagrid

i basically have a datagrid that im populating from a dataset

Me.DataGrid1.DataSource = ds.Tables(0)

the datagrid then has 5 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great

Thanks

Mike

Nov 20 '05 #3
Sadly that made no sense to me at all

Thanks anyway

Mike
"Ali BAKDUR" <al*******@hotmail.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
http://www.knowdotnet.com/articles/kdngrid.html

try this
"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:Qp************@newsfe1-gui.server.ntli.net...
im trying (unsucessfully) to add a checkbox column to my datagrid

i basically have a datagrid that im populating from a dataset

Me.DataGrid1.DataSource = ds.Tables(0)

the datagrid then has 5 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great

Thanks

Mike


Nov 20 '05 #4
Ok,

ive added my TableStyle (i think)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)

but now i still have no idea how to add the extra column

Thanks

Mike
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
You need to add a TableStyle to the Grid, including the Columns you want.
Make the last Column you add to the style a DataGridCheckBoxColumn

/Lars
"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:Qp************@newsfe1-gui.server.ntli.net...
im trying (unsucessfully) to add a checkbox column to my datagrid

i basically have a datagrid that im populating from a dataset

Me.DataGrid1.DataSource = ds.Tables(0)

the datagrid then has 5 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great

Thanks

Mike


Nov 20 '05 #5
thanks, well that sort of helped as i can now manuipulate my other columns
easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you originally
mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...
Here: You create a Column and add to the style that you then add to the Grid (like you did)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn

txtID.MappingName = "ID column name from database"

txtID.HeaderText = "ID"

txtID.Width = 50

ts.GridColumnStyles.Add(txtID)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
/Lars

"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:rf*************@newsfe1-gui.server.ntli.net...
Ok,

ive added my TableStyle (i think)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)

but now i still have no idea how to add the extra column

Thanks

Mike
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
You need to add a TableStyle to the Grid, including the Columns you want. Make the last Column you add to the style a DataGridCheckBoxColumn

/Lars
"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet news:Qp************@newsfe1-gui.server.ntli.net...
> im trying (unsucessfully) to add a checkbox column to my datagrid
>
> i basically have a datagrid that im populating from a dataset
>
> Me.DataGrid1.DataSource = ds.Tables(0)
>
> the datagrid then has 5 columns in it but i need to add a sixth column > which will be my checkbox column - any help or pointers with this
> would be great
>
> Thanks
>
> Mike
>
>



Nov 20 '05 #6
Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net:
thanks, well that sort of helped as i can now manuipulate my other columns

easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you originally
mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...
Here: You create a Column and add to the style that you then add to
the


Grid
(like you did)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn

txtID.MappingName = "ID column name from database"

txtID.HeaderText = "ID"

txtID.Width = 50

ts.GridColumnStyles.Add(txtID)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
/Lars

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
.uk> skrev i meddelandet
news:rf*************@newsfe1-gui.server.ntli.net...

Ok,

ive added my TableStyle (i think)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)

but now i still have no idea how to add the extra column

Thanks

Mike
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl... You need to add a TableStyle to the Grid, including the Columns
> you
want.

Make the last Column you add to the style a DataGridCheckBoxColumn
>
> /Lars
>
>
> "Mike Fellows" <HYPERLINK
> "mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
> .uk> skrev i
meddelandet
news:Qp************@newsfe1-gui.server.ntli.net... > im trying (unsucessfully) to add a checkbox column to my
> > datagrid
> >
> > i basically have a datagrid that im populating from a dataset
> >
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> > the datagrid then has 5 columns in it but i need to add a sixth
column
> which will be my checkbox column - any help or pointers with
> > this
> > would be great
> >
> > Thanks
> >
> > Mike
> >
> >
>
>



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #7
Thanks Ken

works a treat

Mike

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net:
thanks, well that sort of helped as i can now manuipulate my other columns
easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you originally
mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...
Here: You create a Column and add to the style that you then add to
the


Grid
(like you did)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn

txtID.MappingName = "ID column name from database"

txtID.HeaderText = "ID"

txtID.Width = 50

ts.GridColumnStyles.Add(txtID)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
/Lars

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co .uk> skrev i meddelandet
news:rf*************@newsfe1-gui.server.ntli.net...

> Ok,
>
> ive added my TableStyle (i think)
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Table"
> DataGrid1.TableStyles.Clear()
> DataGrid1.TableStyles.Add(ts)
> Me.DataGrid1.DataSource = ds.Tables(0)
>
> but now i still have no idea how to add the extra column
>
> Thanks
>
> Mike
>
>
> "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> news:%2******************@TK2MSFTNGP11.phx.gbl...

> > You need to add a TableStyle to the Grid, including the Columns
> > you

want.

> > Make the last Column you add to the style a DataGridCheckBoxColumn
> >
> > /Lars
> >
> >
> > "Mike Fellows" <HYPERLINK
> > "mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co > > .uk> skrev i


meddelandet
> > news:Qp************@newsfe1-gui.server.ntli.net...

> > > im trying (unsucessfully) to add a checkbox column to my
> > > datagrid
> > >
> > > i basically have a datagrid that im populating from a dataset
> > >
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > > the datagrid then has 5 columns in it but i need to add a sixth


column
> > > which will be my checkbox column - any help or pointers with
> > > this
> > > would be great
> > >
> > > Thanks
> > >
> > > Mike
> > >
> > >
> >
> >
>
>



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004

Nov 20 '05 #8
Ken,

any idea why my checkbox seems to have 3 states, True, false and DBNull

Mike

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net:
thanks, well that sort of helped as i can now manuipulate my other columns
easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you originally
mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...
Here: You create a Column and add to the style that you then add to
the


Grid
(like you did)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn

txtID.MappingName = "ID column name from database"

txtID.HeaderText = "ID"

txtID.Width = 50

ts.GridColumnStyles.Add(txtID)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
/Lars

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co .uk> skrev i meddelandet
news:rf*************@newsfe1-gui.server.ntli.net...

> Ok,
>
> ive added my TableStyle (i think)
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Table"
> DataGrid1.TableStyles.Clear()
> DataGrid1.TableStyles.Add(ts)
> Me.DataGrid1.DataSource = ds.Tables(0)
>
> but now i still have no idea how to add the extra column
>
> Thanks
>
> Mike
>
>
> "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> news:%2******************@TK2MSFTNGP11.phx.gbl...

> > You need to add a TableStyle to the Grid, including the Columns
> > you

want.

> > Make the last Column you add to the style a DataGridCheckBoxColumn
> >
> > /Lars
> >
> >
> > "Mike Fellows" <HYPERLINK
> > "mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co > > .uk> skrev i


meddelandet
> > news:Qp************@newsfe1-gui.server.ntli.net...

> > > im trying (unsucessfully) to add a checkbox column to my
> > > datagrid
> > >
> > > i basically have a datagrid that im populating from a dataset
> > >
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > > the datagrid then has 5 columns in it but i need to add a sixth


column
> > > which will be my checkbox column - any help or pointers with
> > > this
> > > would be great
> > >
> > > Thanks
> > >
> > > Mike
> > >
> > >
> >
> >
>
>



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004

Nov 20 '05 #9
Hi,

That's it default behavior.
http://msdn.microsoft.com/library/de...ClassTopic.asp

Ken
---------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net:
Ken,

any idea why my checkbox seems to have 3 states, True, false and DBNull

Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
.uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net:

thanks, well that sort of helped as i can now manuipulate my other
columns

easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you
originally
mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...
Here: You create a Column and add to the style that you then add
> to
> the
Grid
(like you did)
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBoxColumn
>
> txtID.MappingName = "ID column name from database"
>
> txtID.HeaderText = "ID"
>
> txtID.Width = 50
>
> ts.GridColumnStyles.Add(txtID)
>
> DataGrid1.TableStyles.Clear()
> DataGrid1.TableStyles.Add(ts)
> Me.DataGrid1.DataSource = ds.Tables(0)
>
>
> /Lars
>
> "Mike Fellows" <HYPERLINK
>
"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
.uk> skrev i meddelandet
> news:rf*************@newsfe1-gui.server.ntli.net...
> Ok,
> >
> > ive added my TableStyle (i think)
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> > but now i still have no idea how to add the extra column
> >
> > Thanks
> >
> > Mike
> >
> >
> > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > news:%2******************@TK2MSFTNGP11.phx.gbl...
> > You need to add a TableStyle to the Grid, including the
> > > Columns
> > > you
want.
> > Make the last Column you add to the style a
> > > DataGridCheckBoxColumn
> > >
> > > /Lars
> > >
> > >
> > > "Mike Fellows" <HYPERLINK
> > >
"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > .uk> skrev i
meddelandet
> > news:Qp************@newsfe1-gui.server.ntli.net...
> > > im trying (unsucessfully) to add a checkbox column to my
> > > > datagrid
> > > >
> > > > i basically have a datagrid that im populating from a
> > > > dataset
> > > >
> > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > >
> > > > the datagrid then has 5 columns in it but i need to add a
> > > > sixth
column
> > > which will be my checkbox column - any help or pointers with
> > > > this
> > > > would be great
> > > >
> > > > Thanks
> > > >
> > > > Mike
> > > >
> > > >
> > >
> > >
> >
> >
>

>

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #10
Here: You create a Column and add to the style that you then add to the Grid
(like you did)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn

txtID.MappingName = "ID column name from database"

txtID.HeaderText = "ID"

txtID.Width = 50

ts.GridColumnStyles.Add(txtID)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
/Lars

"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:rf*************@newsfe1-gui.server.ntli.net...
Ok,

ive added my TableStyle (i think)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)

but now i still have no idea how to add the extra column

Thanks

Mike
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
You need to add a TableStyle to the Grid, including the Columns you want. Make the last Column you add to the style a DataGridCheckBoxColumn

/Lars
"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:Qp************@newsfe1-gui.server.ntli.net...
im trying (unsucessfully) to add a checkbox column to my datagrid

i basically have a datagrid that im populating from a dataset

Me.DataGrid1.DataSource = ds.Tables(0)

the datagrid then has 5 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great

Thanks

Mike



Nov 20 '05 #11
Ken,

im now looking around the web to be able to do a combobox column too
but everything says i should be able to access DataGridComboBoxColumn

this does not exist as far as i can tell (this was the same as i was told
earlier for the DataGridCheckBoxColumn which didnt exist either)

im using .net 2003 with framwork 1.1 so i should be up to date

why dont these objects exist?

and how do i transform a DataGridTextBoxColumn which i have into a
combobox?

this is such a pain in the arse (roll on whigby with its new datagrids)

Mike

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ek**************@tk2msftngp13.phx.gbl...
Hi,

That's it default behavior.
http://msdn.microsoft.com/library/de...ClassTopic.asp
Ken
---------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net:
Ken,

any idea why my checkbox seems to have 3 states, True, false and DBNull

Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co .uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net:

> thanks, well that sort of helped as i can now manuipulate my other


columns
>
> easier but im still no closer to adding a
> check box
>
> heres my current code:
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBoxColumn
> txtID.MappingName = "ID"
> txtID.HeaderText = "ID"
> txtID.Width = 50
> ts.GridColumnStyles.Add(txtID)
>
> Dim txtID1 As New DataGridTextBoxColumn
> txtID1.MappingName = "Postcode"
> txtID1.HeaderText = "Postcode"
> txtID1.Width = 80
> ts.GridColumnStyles.Add(txtID1)
>
> Dim txtID2 As New DataGridTextBoxColumn
> txtID2.MappingName = "DistributionVolume"
> txtID2.HeaderText = "Distribution Volume"
> txtID2.Width = 80
> ts.GridColumnStyles.Add(txtID2)
>
> Dim txtID3 As New DataGridTextBoxColumn
> txtID3.MappingName = "Distributor"
> txtID3.HeaderText = "Distributor"
> txtID3.Width = 80
> ts.GridColumnStyles.Add(txtID3)
>
> Dim txtID4 As New DataGridTextBoxColumn
> txtID4.MappingName = "Frequency"
> txtID4.HeaderText = "Frequency"
> txtID4.Width = 80
> ts.GridColumnStyles.Add(txtID4)
>
> Dim txtID5 As New DataGridTextBoxColumn
> txtID5.MappingName = "WeekCommencing"
> txtID5.HeaderText = "Week Commencing"
> txtID5.Width = 80
> ts.GridColumnStyles.Add(txtID5)
>
> Dim txtID6 As New DataGridTextBoxColumn
> txtID6.MappingName = "Active"
> txtID6.HeaderText = "Active"
> txtID6.Width = 80
> ts.GridColumnStyles.Add(txtID6)
>
> Dim txtID7 As New DataGridTextBoxColumn
> txtID7.MappingName = ""
> txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnStyles.Add(txtID7)
>
> DataGrid1.TableStyles.Clear()
> DataGrid1.TableStyles.Add(ts)
> Me.DataGrid1.DataSource = ds.Tables(0)
>
>
> i dont seem to be able to add the DataGridCheckBoxColumn you
> originally
> mentioned
> and also this column should not be mapped to anything
>
> Thanks
>
> Mike
>
> "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> news:OF*************@TK2MSFTNGP11.phx.gbl...
>

> > Here: You create a Column and add to the style that you then add
> > to
> > the
>

> Grid
>

> > (like you did)
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBoxColumn
> >
> > txtID.MappingName = "ID column name from database"
> >
> > txtID.HeaderText = "ID"
> >
> > txtID.Width = 50
> >
> > ts.GridColumnStyles.Add(txtID)
> >
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> >
> > /Lars
> >
> > "Mike Fellows" <HYPERLINK
> >


"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > .uk> skrev i meddelandet
> > news:rf*************@newsfe1-gui.server.ntli.net...
>

> > > Ok,
> > >
> > > ive added my TableStyle (i think)
> > >
> > > Dim ts As New DataGridTableStyle
> > > ts.MappingName = "Table"
> > > DataGrid1.TableStyles.Clear()
> > > DataGrid1.TableStyles.Add(ts)
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > > but now i still have no idea how to add the extra column
> > >
> > > Thanks
> > >
> > > Mike
> > >
> > >
> > > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > > news:%2******************@TK2MSFTNGP11.phx.gbl...
>

> > > > You need to add a TableStyle to the Grid, including the
> > > > Columns
> > > > you
>

> > want.
>

> > > > Make the last Column you add to the style a
> > > > DataGridCheckBoxColumn
> > > >
> > > > /Lars
> > > >
> > > >
> > > > "Mike Fellows" <HYPERLINK
> > > >


"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > > .uk> skrev i
>

> meddelandet
>

> > > > news:Qp************@newsfe1-gui.server.ntli.net...
>

> > > > > im trying (unsucessfully) to add a checkbox column to my
> > > > > datagrid
> > > > >
> > > > > i basically have a datagrid that im populating from a
> > > > > dataset
> > > > >
> > > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > > >
> > > > > the datagrid then has 5 columns in it but i need to add a
> > > > > sixth
>

> column
>

> > > > > which will be my checkbox column - any help or pointers with
> > > > > this
> > > > > would be great
> > > > >
> > > > > Thanks
> > > > >
> > > > > Mike
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
> >
>

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004

Nov 20 '05 #12
Hi,

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q480q

Ken
---------------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:huDzc.99$eM3.71@newsfe1-win:
Ken,

im now looking around the web to be able to do a combobox column too
but everything says i should be able to access DataGridComboBoxColumn

this does not exist as far as i can tell (this was the same as i was told

earlier for the DataGridCheckBoxColumn which didnt exist either)

im using .net 2003 with framwork 1.1 so i should be up to date

why dont these objects exist?

and how do i transform a DataGridTextBoxColumn which i have into a
combobox?

this is such a pain in the arse (roll on whigby with its new datagrids)

Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:ek**************@tk2msftngp13.phx.gbl...
Hi,

That's it default behavior.


HYPERLINK
"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
/frlrfSystemWindowsFormsDataGridBoolColumnClassTopi c.asp"http://msdn.microso
ft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsF
ormsDataGridBoolColumnClassTopic.asp

Ken
---------------

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
.uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net:

Ken,

any idea why my checkbox seems to have 3 states, True, false and
DBNull

Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Hi,
>
> Add a new column to your dataset. Add a datagridboolcolumn to
> your
> tablestyle.
>
> Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
> dc.DefaultValue = False
> ds.Tables("Table").Columns.Add(dc)
>
> Dim txtID7 As New DataGridBoolColumn
> txtID7.MappingName = "MyBoolColumn"
> txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnStyles.Add(txtID7)
>
> Ken
> ------------------
>
> "Mike Fellows" <HYPERLINK
>
"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
.uk> wrote in message
> news:DM************@newsfe1-gui.server.ntli.net:
> thanks, well that sort of helped as i can now manuipulate my
> > other
columns
>
> > easier but im still no closer to adding a
> > check box
> >
> > heres my current code:
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBoxColumn
> > txtID.MappingName = "ID"
> > txtID.HeaderText = "ID"
> > txtID.Width = 50
> > ts.GridColumnStyles.Add(txtID)
> >
> > Dim txtID1 As New DataGridTextBoxColumn
> > txtID1.MappingName = "Postcode"
> > txtID1.HeaderText = "Postcode"
> > txtID1.Width = 80
> > ts.GridColumnStyles.Add(txtID1)
> >
> > Dim txtID2 As New DataGridTextBoxColumn
> > txtID2.MappingName = "DistributionVolume"
> > txtID2.HeaderText = "Distribution Volume"
> > txtID2.Width = 80
> > ts.GridColumnStyles.Add(txtID2)
> >
> > Dim txtID3 As New DataGridTextBoxColumn
> > txtID3.MappingName = "Distributor"
> > txtID3.HeaderText = "Distributor"
> > txtID3.Width = 80
> > ts.GridColumnStyles.Add(txtID3)
> >
> > Dim txtID4 As New DataGridTextBoxColumn
> > txtID4.MappingName = "Frequency"
> > txtID4.HeaderText = "Frequency"
> > txtID4.Width = 80
> > ts.GridColumnStyles.Add(txtID4)
> >
> > Dim txtID5 As New DataGridTextBoxColumn
> > txtID5.MappingName = "WeekCommencing"
> > txtID5.HeaderText = "Week Commencing"
> > txtID5.Width = 80
> > ts.GridColumnStyles.Add(txtID5)
> >
> > Dim txtID6 As New DataGridTextBoxColumn
> > txtID6.MappingName = "Active"
> > txtID6.HeaderText = "Active"
> > txtID6.Width = 80
> > ts.GridColumnStyles.Add(txtID6)
> >
> > Dim txtID7 As New DataGridTextBoxColumn
> > txtID7.MappingName = ""
> > txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> > txtID7.Width = 120
> > ts.GridColumnStyles.Add(txtID7)
> >
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> >
> > i dont seem to be able to add the DataGridCheckBoxColumn you
> > originally
> > mentioned
> > and also this column should not be mapped to anything
> >
> > Thanks
> >
> > Mike
> >
> > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > news:OF*************@TK2MSFTNGP11.phx.gbl...
> >
> > Here: You create a Column and add to the style that you then
> > > add
> > > to
> > > the
> >
> Grid
> >
> > (like you did)
> > >
> > > Dim ts As New DataGridTableStyle
> > > ts.MappingName = "Table"
> > >
> > > Dim txtID As New DataGridTextBoxColumn
> > >
> > > txtID.MappingName = "ID column name from database"
> > >
> > > txtID.HeaderText = "ID"
> > >
> > > txtID.Width = 50
> > >
> > > ts.GridColumnStyles.Add(txtID)
> > >
> > > DataGrid1.TableStyles.Clear()
> > > DataGrid1.TableStyles.Add(ts)
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > >
> > > /Lars
> > >
> > > "Mike Fellows" <HYPERLINK
> > >
"mailto:mi***************@equityhouse.co.uk"HYPERL INK

"mailto:mi***************@equityhouse.co"HYPER LINK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > .uk> skrev i meddelandet
> > > news:rf*************@newsfe1-gui.server.ntli.net...
> >
> > > Ok,
> > > >
> > > > ive added my TableStyle (i think)
> > > >
> > > > Dim ts As New DataGridTableStyle
> > > > ts.MappingName = "Table"
> > > > DataGrid1.TableStyles.Clear()
> > > > DataGrid1.TableStyles.Add(ts)
> > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > >
> > > > but now i still have no idea how to add the extra column
> > > >
> > > > Thanks
> > > >
> > > > Mike
> > > >
> > > >
> > > > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > > > news:%2******************@TK2MSFTNGP11.phx.gbl...
> >
> > > > You need to add a TableStyle to the Grid, including the
> > > > > Columns
> > > > > you
> >
> > want.
> >
> > > > Make the last Column you add to the style a
> > > > > DataGridCheckBoxColumn
> > > > >
> > > > > /Lars
> > > > >
> > > > >
> > > > > "Mike Fellows" <HYPERLINK
> > > > >
"mailto:mi***************@equityhouse.co.uk"HYPERL INK

"mailto:mi***************@equityhouse.co"HYPER LINK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > > .uk> skrev i
> >
> meddelandet
> >
> > > > news:Qp************@newsfe1-gui.server.ntli.net...
> >
> > > > > im trying (unsucessfully) to add a checkbox column to my
> > > > > > datagrid
> > > > > >
> > > > > > i basically have a datagrid that im populating from a
> > > > > > dataset
> > > > > >
> > > > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > > > >
> > > > > > the datagrid then has 5 columns in it but i need to add
> > > > > > a
> > > > > > sixth
> >
> column
> >
> > > > > which will be my checkbox column - any help or pointers
> > > > > > with
> > > > > > this
> > > > > > would be great
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Mike
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> > >
> >
>
--
> Outgoing mail is certified Virus Free.
> Checked by AVG Anti-Virus (http://www.grisoft.com).
> Version: 7.0.230 / Virus Database: 263.3.0 - Release Date:
> 6/12/2004
>
>

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #13
Just now I ask same question related with this caption.
I add a checkbox column myself to the datagrid
at the run time if you click ones it's states turn to lock mode if you clik
seceond time it turn to un checked mode
how can I arrange this stiuation ?
"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net...
Ken,

any idea why my checkbox seems to have 3 states, True, false and DBNull

Mike

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net:
thanks, well that sort of helped as i can now manuipulate my other columns
easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you originally mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...

> Here: You create a Column and add to the style that you then add to
> the

Grid

> (like you did)
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBoxColumn
>
> txtID.MappingName = "ID column name from database"
>
> txtID.HeaderText = "ID"
>
> txtID.Width = 50
>
> ts.GridColumnStyles.Add(txtID)
>
> DataGrid1.TableStyles.Clear()
> DataGrid1.TableStyles.Add(ts)
> Me.DataGrid1.DataSource = ds.Tables(0)
>
>
> /Lars
>
> "Mike Fellows" <HYPERLINK
>

"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
> .uk> skrev i meddelandet
> news:rf*************@newsfe1-gui.server.ntli.net...

> > Ok,
> >
> > ive added my TableStyle (i think)
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> > but now i still have no idea how to add the extra column
> >
> > Thanks
> >
> > Mike
> >
> >
> > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > news:%2******************@TK2MSFTNGP11.phx.gbl...

> > > You need to add a TableStyle to the Grid, including the Columns
> > > you

> want.

> > > Make the last Column you add to the style a DataGridCheckBoxColumn > > >
> > > /Lars
> > >
> > >
> > > "Mike Fellows" <HYPERLINK
> > >

"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
> > > .uk> skrev i

meddelandet

> > > news:Qp************@newsfe1-gui.server.ntli.net...

> > > > im trying (unsucessfully) to add a checkbox column to my
> > > > datagrid
> > > >
> > > > i basically have a datagrid that im populating from a dataset
> > > >
> > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > >
> > > > the datagrid then has 5 columns in it but i need to add a sixth
column

> > > > which will be my checkbox column - any help or pointers with
> > > > this
> > > > would be great
> > > >
> > > > Thanks
> > > >
> > > > Mike
> > > >
> > > >
> > >
> > >
> >
> >
>

>


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004


Nov 20 '05 #14
Hi,

http://www.dotnet247.com/247referenc.../16/80655.aspx

Ken
------------

"Ali baba the 40th" <al*******@hotmail.com> wrote in message
news:#V**************@TK2MSFTNGP10.phx.gbl:
Just now I ask same question related with this caption.
I add a checkbox column myself to the datagrid
at the run time if you click ones it's states turn to lock mode if you
clik
seceond time it turn to un checked mode
how can I arrange this stiuation ?
"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
.uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net...
Ken,

any idea why my checkbox seems to have 3 states, True, false and
DBNull

Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...

Hi,

Add a new column to your dataset. Add a datagridboolcolumn to your
tablestyle.

Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
ds.Tables("Table").Columns.Add(dc)

Dim txtID7 As New DataGridBoolColumn
txtID7.MappingName = "MyBoolColumn"
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

Ken
------------------

"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
.uk> wrote in message
news:DM************@newsfe1-gui.server.ntli.net: thanks, well that sort of helped as i can now manuipulate my other
columns


> easier but im still no closer to adding a
> check box
>
> heres my current code:
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBoxColumn
> txtID.MappingName = "ID"
> txtID.HeaderText = "ID"
> txtID.Width = 50
> ts.GridColumnStyles.Add(txtID)
>
> Dim txtID1 As New DataGridTextBoxColumn
> txtID1.MappingName = "Postcode"
> txtID1.HeaderText = "Postcode"
> txtID1.Width = 80
> ts.GridColumnStyles.Add(txtID1)
>
> Dim txtID2 As New DataGridTextBoxColumn
> txtID2.MappingName = "DistributionVolume"
> txtID2.HeaderText = "Distribution Volume"
> txtID2.Width = 80
> ts.GridColumnStyles.Add(txtID2)
>
> Dim txtID3 As New DataGridTextBoxColumn
> txtID3.MappingName = "Distributor"
> txtID3.HeaderText = "Distributor"
> txtID3.Width = 80
> ts.GridColumnStyles.Add(txtID3)
>
> Dim txtID4 As New DataGridTextBoxColumn
> txtID4.MappingName = "Frequency"
> txtID4.HeaderText = "Frequency"
> txtID4.Width = 80
> ts.GridColumnStyles.Add(txtID4)
>
> Dim txtID5 As New DataGridTextBoxColumn
> txtID5.MappingName = "WeekCommencing"
> txtID5.HeaderText = "Week Commencing"
> txtID5.Width = 80
> ts.GridColumnStyles.Add(txtID5)
>
> Dim txtID6 As New DataGridTextBoxColumn
> txtID6.MappingName = "Active"
> txtID6.HeaderText = "Active"
> txtID6.Width = 80
> ts.GridColumnStyles.Add(txtID6)
>
> Dim txtID7 As New DataGridTextBoxColumn
> txtID7.MappingName = ""
> txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnStyles.Add(txtID7)
>
> DataGrid1.TableStyles.Clear()
> DataGrid1.TableStyles.Add(ts)
> Me.DataGrid1.DataSource = ds.Tables(0)
>
>
> i dont seem to be able to add the DataGridCheckBoxColumn you
originally
mentioned
> and also this column should not be mapped to anything
>
> Thanks
>
> Mike
>
> "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> news:OF*************@TK2MSFTNGP11.phx.gbl...
> > Here: You create a Column and add to the style that you then add
> > to
> > the
> Grid
> > (like you did)
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBoxColumn
> >
> > txtID.MappingName = "ID column name from database"
> >
> > txtID.HeaderText = "ID"
> >
> > txtID.Width = 50
> >
> > ts.GridColumnStyles.Add(txtID)
> >
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> >
> > /Lars
> >
> > "Mike Fellows" <HYPERLINK
> >


"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> .uk> skrev i meddelandet
> > news:rf*************@newsfe1-gui.server.ntli.net...
> > > Ok,
> > >
> > > ive added my TableStyle (i think)
> > >
> > > Dim ts As New DataGridTableStyle
> > > ts.MappingName = "Table"
> > > DataGrid1.TableStyles.Clear()
> > > DataGrid1.TableStyles.Add(ts)
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > > but now i still have no idea how to add the extra column
> > >
> > > Thanks
> > >
> > > Mike
> > >
> > >
> > > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > > news:%2******************@TK2MSFTNGP11.phx.gbl...
> > > > You need to add a TableStyle to the Grid, including the
> > > > Columns
> > > > you
> > want.
> > > > Make the last Column you add to the style a
DataGridCheckBoxColumn
> > >
> > > > /Lars
> > > >
> > > >
> > > > "Mike Fellows" <HYPERLINK
> > > >


"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > .uk> skrev i
> meddelandet
> > > > news:Qp************@newsfe1-gui.server.ntli.net...
> > > > > im trying (unsucessfully) to add a checkbox column to my
> > > > > datagrid
> > > > >
> > > > > i basically have a datagrid that im populating from a
> > > > > dataset
> > > > >
> > > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > > >
> > > > > the datagrid then has 5 columns in it but i need to add a
sixth

> column
> > > > > which will be my checkbox column - any help or pointers
> > > > > with
> > > > > this
> > > > > would be great
> > > > >
> > > > > Thanks
> > > > >
> > > > > Mike
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
> >
>
--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #15
There's no default class for this, you need to download a class from the
site provided in the pther message. I needed this for sure and I spent a few
hours to get it to work, but that class is not very nice, it lacks several
handlers for key events and doesnt raise events either, don't asume it'll be
as working with a normal ComboBOx. I had to modify the class I downloaded
pretty much but that's custumized a lot with the rest of my form and the
grid it's in so I dont' think it'll help you very much lookng at it.

But I got it workning. So I'll try to answer questions

/Lars

"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:huDzc.99$eM3.71@newsfe1-win...
Ken,

im now looking around the web to be able to do a combobox column too
but everything says i should be able to access DataGridComboBoxColumn

this does not exist as far as i can tell (this was the same as i was told
earlier for the DataGridCheckBoxColumn which didnt exist either)

im using .net 2003 with framwork 1.1 so i should be up to date

why dont these objects exist?

and how do i transform a DataGridTextBoxColumn which i have into a
combobox?

this is such a pain in the arse (roll on whigby with its new datagrids)

Mike

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ek**************@tk2msftngp13.phx.gbl...
Hi,

That's it default behavior.

http://msdn.microsoft.com/library/de...ClassTopic.asp

Ken
---------------

"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net:
Ken,

any idea why my checkbox seems to have 3 states, True, false and DBNull
Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...

> Hi,
>
> Add a new column to your dataset. Add a datagridboolcolumn to your
> tablestyle.
>
> Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
> dc.DefaultValue = False
> ds.Tables("Table").Columns.Add(dc)
>
> Dim txtID7 As New DataGridBoolColumn
> txtID7.MappingName = "MyBoolColumn"
> txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnStyles.Add(txtID7)
>
> Ken
> ------------------
>
> "Mike Fellows" <HYPERLINK
>

"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co
> .uk> wrote in message
> news:DM************@newsfe1-gui.server.ntli.net:

> > thanks, well that sort of helped as i can now manuipulate my other

columns

> >
> > easier but im still no closer to adding a
> > check box
> >
> > heres my current code:
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBoxColumn
> > txtID.MappingName = "ID"
> > txtID.HeaderText = "ID"
> > txtID.Width = 50
> > ts.GridColumnStyles.Add(txtID)
> >
> > Dim txtID1 As New DataGridTextBoxColumn
> > txtID1.MappingName = "Postcode"
> > txtID1.HeaderText = "Postcode"
> > txtID1.Width = 80
> > ts.GridColumnStyles.Add(txtID1)
> >
> > Dim txtID2 As New DataGridTextBoxColumn
> > txtID2.MappingName = "DistributionVolume"
> > txtID2.HeaderText = "Distribution Volume"
> > txtID2.Width = 80
> > ts.GridColumnStyles.Add(txtID2)
> >
> > Dim txtID3 As New DataGridTextBoxColumn
> > txtID3.MappingName = "Distributor"
> > txtID3.HeaderText = "Distributor"
> > txtID3.Width = 80
> > ts.GridColumnStyles.Add(txtID3)
> >
> > Dim txtID4 As New DataGridTextBoxColumn
> > txtID4.MappingName = "Frequency"
> > txtID4.HeaderText = "Frequency"
> > txtID4.Width = 80
> > ts.GridColumnStyles.Add(txtID4)
> >
> > Dim txtID5 As New DataGridTextBoxColumn
> > txtID5.MappingName = "WeekCommencing"
> > txtID5.HeaderText = "Week Commencing"
> > txtID5.Width = 80
> > ts.GridColumnStyles.Add(txtID5)
> >
> > Dim txtID6 As New DataGridTextBoxColumn
> > txtID6.MappingName = "Active"
> > txtID6.HeaderText = "Active"
> > txtID6.Width = 80
> > ts.GridColumnStyles.Add(txtID6)
> >
> > Dim txtID7 As New DataGridTextBoxColumn
> > txtID7.MappingName = ""
> > txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> > txtID7.Width = 120
> > ts.GridColumnStyles.Add(txtID7)
> >
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> >
> > i dont seem to be able to add the DataGridCheckBoxColumn you
> > originally
> > mentioned
> > and also this column should not be mapped to anything
> >
> > Thanks
> >
> > Mike
> >
> > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > news:OF*************@TK2MSFTNGP11.phx.gbl...
> >

> > > Here: You create a Column and add to the style that you then add
> > > to
> > > the
> >

> > Grid
> >

> > > (like you did)
> > >
> > > Dim ts As New DataGridTableStyle
> > > ts.MappingName = "Table"
> > >
> > > Dim txtID As New DataGridTextBoxColumn
> > >
> > > txtID.MappingName = "ID column name from database"
> > >
> > > txtID.HeaderText = "ID"
> > >
> > > txtID.Width = 50
> > >
> > > ts.GridColumnStyles.Add(txtID)
> > >
> > > DataGrid1.TableStyles.Clear()
> > > DataGrid1.TableStyles.Add(ts)
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > >
> > > /Lars
> > >
> > > "Mike Fellows" <HYPERLINK
> > >

"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > .uk> skrev i meddelandet
> > > news:rf*************@newsfe1-gui.server.ntli.net...
> >

> > > > Ok,
> > > >
> > > > ive added my TableStyle (i think)
> > > >
> > > > Dim ts As New DataGridTableStyle
> > > > ts.MappingName = "Table"
> > > > DataGrid1.TableStyles.Clear()
> > > > DataGrid1.TableStyles.Add(ts)
> > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > >
> > > > but now i still have no idea how to add the extra column
> > > >
> > > > Thanks
> > > >
> > > > Mike
> > > >
> > > >
> > > > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > > > news:%2******************@TK2MSFTNGP11.phx.gbl...
> >

> > > > > You need to add a TableStyle to the Grid, including the
> > > > > Columns
> > > > > you
> >

> > > want.
> >

> > > > > Make the last Column you add to the style a
> > > > > DataGridCheckBoxColumn
> > > > >
> > > > > /Lars
> > > > >
> > > > >
> > > > > "Mike Fellows" <HYPERLINK
> > > > >

"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > > > .uk> skrev i
> >

> > meddelandet
> >

> > > > > news:Qp************@newsfe1-gui.server.ntli.net...
> >

> > > > > > im trying (unsucessfully) to add a checkbox column to my
> > > > > > datagrid
> > > > > >
> > > > > > i basically have a datagrid that im populating from a
> > > > > > dataset
> > > > > >
> > > > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > > > >
> > > > > > the datagrid then has 5 columns in it but i need to add a
> > > > > > sixth
> >

> > column
> >

> > > > > > which will be my checkbox column - any help or pointers with > > > > > > this
> > > > > > would be great
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Mike
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> > >
> >
>

> --
> Outgoing mail is certified Virus Free.
> Checked by AVG Anti-Virus (http://www.grisoft.com).
> Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
>
>


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004


Nov 20 '05 #16
nice solution
thanks
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
Hi,

http://www.dotnet247.com/247referenc.../16/80655.aspx

Ken
------------

"Ali baba the 40th" <al*******@hotmail.com> wrote in message
news:#V**************@TK2MSFTNGP10.phx.gbl:
Just now I ask same question related with this caption.
I add a checkbox column myself to the datagrid
at the run time if you click ones it's states turn to lock mode if you
clik
seceond time it turn to un checked mode
how can I arrange this stiuation ?
"Mike Fellows" <HYPERLINK
"mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co .uk> wrote in message
news:UJ*************@newsfe1-gui.server.ntli.net...
Ken,

any idea why my checkbox seems to have 3 states, True, false and
DBNull

Mike

"Ken Tucker [MVP]" <HYPERLINK
"mailto:vb***@bellsouth.net"vb***@bellsouth.ne t> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...

> Hi,
>
> Add a new column to your dataset. Add a datagridboolcolumn to your
> tablestyle.
>
> Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
> dc.DefaultValue = False
> ds.Tables("Table").Columns.Add(dc)
>
> Dim txtID7 As New DataGridBoolColumn
> txtID7.MappingName = "MyBoolColumn"
> txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnStyles.Add(txtID7)
>
> Ken
> ------------------
>
> "Mike Fellows" <HYPERLINK
> "mailto:mi***************@equityhouse.co.uk"mi**** ***********@equityhouse.co > .uk> wrote in message
> news:DM************@newsfe1-gui.server.ntli.net:

> > thanks, well that sort of helped as i can now manuipulate my other

columns

> >
> > easier but im still no closer to adding a
> > check box
> >
> > heres my current code:
> >
> > Dim ts As New DataGridTableStyle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBoxColumn
> > txtID.MappingName = "ID"
> > txtID.HeaderText = "ID"
> > txtID.Width = 50
> > ts.GridColumnStyles.Add(txtID)
> >
> > Dim txtID1 As New DataGridTextBoxColumn
> > txtID1.MappingName = "Postcode"
> > txtID1.HeaderText = "Postcode"
> > txtID1.Width = 80
> > ts.GridColumnStyles.Add(txtID1)
> >
> > Dim txtID2 As New DataGridTextBoxColumn
> > txtID2.MappingName = "DistributionVolume"
> > txtID2.HeaderText = "Distribution Volume"
> > txtID2.Width = 80
> > ts.GridColumnStyles.Add(txtID2)
> >
> > Dim txtID3 As New DataGridTextBoxColumn
> > txtID3.MappingName = "Distributor"
> > txtID3.HeaderText = "Distributor"
> > txtID3.Width = 80
> > ts.GridColumnStyles.Add(txtID3)
> >
> > Dim txtID4 As New DataGridTextBoxColumn
> > txtID4.MappingName = "Frequency"
> > txtID4.HeaderText = "Frequency"
> > txtID4.Width = 80
> > ts.GridColumnStyles.Add(txtID4)
> >
> > Dim txtID5 As New DataGridTextBoxColumn
> > txtID5.MappingName = "WeekCommencing"
> > txtID5.HeaderText = "Week Commencing"
> > txtID5.Width = 80
> > ts.GridColumnStyles.Add(txtID5)
> >
> > Dim txtID6 As New DataGridTextBoxColumn
> > txtID6.MappingName = "Active"
> > txtID6.HeaderText = "Active"
> > txtID6.Width = 80
> > ts.GridColumnStyles.Add(txtID6)
> >
> > Dim txtID7 As New DataGridTextBoxColumn
> > txtID7.MappingName = ""
> > txtID7.HeaderText = "CHECKBOX HERE PLEASE"
> > txtID7.Width = 120
> > ts.GridColumnStyles.Add(txtID7)
> >
> > DataGrid1.TableStyles.Clear()
> > DataGrid1.TableStyles.Add(ts)
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> >
> > i dont seem to be able to add the DataGridCheckBoxColumn you


originally
> > mentioned
> > and also this column should not be mapped to anything
> >
> > Thanks
> >
> > Mike
> >
> > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > news:OF*************@TK2MSFTNGP11.phx.gbl...
> >

> > > Here: You create a Column and add to the style that you then add
> > > to
> > > the
> >

> > Grid
> >

> > > (like you did)
> > >
> > > Dim ts As New DataGridTableStyle
> > > ts.MappingName = "Table"
> > >
> > > Dim txtID As New DataGridTextBoxColumn
> > >
> > > txtID.MappingName = "ID column name from database"
> > >
> > > txtID.HeaderText = "ID"
> > >
> > > txtID.Width = 50
> > >
> > > ts.GridColumnStyles.Add(txtID)
> > >
> > > DataGrid1.TableStyles.Clear()
> > > DataGrid1.TableStyles.Add(ts)
> > > Me.DataGrid1.DataSource = ds.Tables(0)
> > >
> > >
> > > /Lars
> > >
> > > "Mike Fellows" <HYPERLINK
> > >



"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > .uk> skrev i meddelandet
> > > news:rf*************@newsfe1-gui.server.ntli.net...
> >

> > > > Ok,
> > > >
> > > > ive added my TableStyle (i think)
> > > >
> > > > Dim ts As New DataGridTableStyle
> > > > ts.MappingName = "Table"
> > > > DataGrid1.TableStyles.Clear()
> > > > DataGrid1.TableStyles.Add(ts)
> > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > >
> > > > but now i still have no idea how to add the extra column
> > > >
> > > > Thanks
> > > >
> > > > Mike
> > > >
> > > >
> > > > "Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
> > > > news:%2******************@TK2MSFTNGP11.phx.gbl...
> >

> > > > > You need to add a TableStyle to the Grid, including the
> > > > > Columns
> > > > > you
> >

> > > want.
> >

> > > > > Make the last Column you add to the style a


DataGridCheckBoxColumn
> > > > >
> > > > > /Lars
> > > > >
> > > > >
> > > > > "Mike Fellows" <HYPERLINK
> > > > >



"mailto:mi***************@equityhouse.co.uk"HYPERL INK
"mailto:mi***************@equityhouse.co"mi******* ********@equityhouse.co
> > > > > .uk> skrev i
> >

> > meddelandet
> >

> > > > > news:Qp************@newsfe1-gui.server.ntli.net...
> >

> > > > > > im trying (unsucessfully) to add a checkbox column to my
> > > > > > datagrid
> > > > > >
> > > > > > i basically have a datagrid that im populating from a
> > > > > > dataset
> > > > > >
> > > > > > Me.DataGrid1.DataSource = ds.Tables(0)
> > > > > >
> > > > > > the datagrid then has 5 columns in it but i need to add a


sixth
> >
> > column
> >

> > > > > > which will be my checkbox column - any help or pointers
> > > > > > with
> > > > > > this
> > > > > > would be great
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Mike
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> > >
> >
>

> --
> Outgoing mail is certified Virus Free.
> Checked by AVG Anti-Virus (http://www.grisoft.com).
> Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
>
>



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004

Nov 20 '05 #17
AJK
Hi..

I was tryin to populate data into a datagrid on my "Pocket PC 2003"
applicaiton (using emulator). Since I'm new to Pocket PC, I tried the way i
was using in ASP.NET. But, got error message:

Following are the code I tried to populate data from SQL CE table to
"DataGrid". But it doesn't work. Apprecaite if you could show any sample code
or URsL showing declaration and using of "DataReader, DataSet, DataAdaptor
etcc in a PocketPC applicaiton.

Dim cn1 As New System.Data.SqlServerCe.SqlCeConnection("Data Source=\my
documents\NWIND_CE.sdf;password=ahd")

Dim cmd1 As New SqlCeCommand
Dim dr1 As SqlCeDataReader
Try
cn1.Open()
cmd1.CommandText = "select
acct_number,acct_name,acct_ibu,acct_group from CMF"
cmd1.Connection = cn1
dr1 = cmd1.ExecuteReader

Me.DataGrid1.DataSource = dr1
dr1.Close()
cn1.Close()
Catch Err As SqlCeException
showErrors(Err)
Finally
cn1 = Nothing
End Try

Many thanks in advance...

Regards,

Ahmed
"Mike Fellows" wrote:
thanks, well that sort of helped as i can now manuipulate my other columns
easier but im still no closer to adding a
check box

heres my current code:

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn
txtID.MappingName = "ID"
txtID.HeaderText = "ID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)

Dim txtID1 As New DataGridTextBoxColumn
txtID1.MappingName = "Postcode"
txtID1.HeaderText = "Postcode"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)

Dim txtID2 As New DataGridTextBoxColumn
txtID2.MappingName = "DistributionVolume"
txtID2.HeaderText = "Distribution Volume"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)

Dim txtID3 As New DataGridTextBoxColumn
txtID3.MappingName = "Distributor"
txtID3.HeaderText = "Distributor"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)

Dim txtID4 As New DataGridTextBoxColumn
txtID4.MappingName = "Frequency"
txtID4.HeaderText = "Frequency"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)

Dim txtID5 As New DataGridTextBoxColumn
txtID5.MappingName = "WeekCommencing"
txtID5.HeaderText = "Week Commencing"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)

Dim txtID6 As New DataGridTextBoxColumn
txtID6.MappingName = "Active"
txtID6.HeaderText = "Active"
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)

Dim txtID7 As New DataGridTextBoxColumn
txtID7.MappingName = ""
txtID7.HeaderText = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnStyles.Add(txtID7)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBoxColumn you originally
mentioned
and also this column should not be mapped to anything

Thanks

Mike

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OF*************@TK2MSFTNGP11.phx.gbl...
Here: You create a Column and add to the style that you then add to the

Grid
(like you did)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBoxColumn

txtID.MappingName = "ID column name from database"

txtID.HeaderText = "ID"

txtID.Width = 50

ts.GridColumnStyles.Add(txtID)

DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
/Lars

"Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet
news:rf*************@newsfe1-gui.server.ntli.net...
Ok,

ive added my TableStyle (i think)

Dim ts As New DataGridTableStyle
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)

but now i still have no idea how to add the extra column

Thanks

Mike
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
> You need to add a TableStyle to the Grid, including the Columns you

want.
> Make the last Column you add to the style a DataGridCheckBoxColumn
>
> /Lars
>
>
> "Mike Fellows" <mi***************@equityhouse.co.uk> skrev i meddelandet > news:Qp************@newsfe1-gui.server.ntli.net...
> > im trying (unsucessfully) to add a checkbox column to my datagrid
> >
> > i basically have a datagrid that im populating from a dataset
> >
> > Me.DataGrid1.DataSource = ds.Tables(0)
> >
> > the datagrid then has 5 columns in it but i need to add a sixth column > > which will be my checkbox column - any help or pointers with this
> > would be great
> >
> > Thanks
> >
> > Mike
> >
> >
>
>



Nov 21 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jean Carlo | last post: by
2 posts views Thread by Sebi | last post: by
reply views Thread by mike | last post: by
4 posts views Thread by Mike | last post: by
2 posts views Thread by Mortar | last post: by
10 posts views Thread by Jennyfer J Barco | last post: by
1 post views Thread by Korara | last post: by
???
reply views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.