473,757 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Da taSource = 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
17 7436
Here: You create a Column and add to the style that you then add to the Grid
(like you did)

Dim ts As New DataGridTableSt yle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBox Column

txtID.MappingNa me = "ID column name from database"

txtID.HeaderTex t = "ID"

txtID.Width = 50

ts.GridColumnSt yles.Add(txtID)

DataGrid1.Table Styles.Clear()
DataGrid1.Table Styles.Add(ts)
Me.DataGrid1.Da taSource = 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 DataGridTableSt yle
ts.MappingName = "Table"
DataGrid1.Table Styles.Clear()
DataGrid1.Table Styles.Add(ts)
Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
You need to add a TableStyle to the Grid, including the Columns you want. Make the last Column you add to the style a DataGridCheckBo xColumn

/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.Da taSource = 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 DataGridComboBo xColumn

this does not exist as far as i can tell (this was the same as i was told
earlier for the DataGridCheckBo xColumn 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 DataGridTextBox Column 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***@bellsout h.net> wrote in message
news:ek******** ******@tk2msftn gp13.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***@b ellsouth.net"vb ***@bellsouth.n et> wrote in message
news:u7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcol umn to your
tablestyle.

Dim dc As New DataColumn("MyB oolColumn", GetType(Boolean ))
dc.DefaultValue = False
ds.Tables("Tabl e").Columns.Add (dc)

Dim txtID7 As New DataGridBoolCol umn
txtID7.MappingN ame = "MyBoolColu mn"
txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnSt yles.Add(txtID7 )

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

"Mike Fellows" <HYPERLINK
"mailto:mi***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o .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 DataGridTableSt yle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBox Column
> txtID.MappingNa me = "ID"
> txtID.HeaderTex t = "ID"
> txtID.Width = 50
> ts.GridColumnSt yles.Add(txtID)
>
> Dim txtID1 As New DataGridTextBox Column
> txtID1.MappingN ame = "Postcode"
> txtID1.HeaderTe xt = "Postcode"
> txtID1.Width = 80
> ts.GridColumnSt yles.Add(txtID1 )
>
> Dim txtID2 As New DataGridTextBox Column
> txtID2.MappingN ame = "DistributionVo lume"
> txtID2.HeaderTe xt = "Distributi on Volume"
> txtID2.Width = 80
> ts.GridColumnSt yles.Add(txtID2 )
>
> Dim txtID3 As New DataGridTextBox Column
> txtID3.MappingN ame = "Distributo r"
> txtID3.HeaderTe xt = "Distributo r"
> txtID3.Width = 80
> ts.GridColumnSt yles.Add(txtID3 )
>
> Dim txtID4 As New DataGridTextBox Column
> txtID4.MappingN ame = "Frequency"
> txtID4.HeaderTe xt = "Frequency"
> txtID4.Width = 80
> ts.GridColumnSt yles.Add(txtID4 )
>
> Dim txtID5 As New DataGridTextBox Column
> txtID5.MappingN ame = "WeekCommencing "
> txtID5.HeaderTe xt = "Week Commencing"
> txtID5.Width = 80
> ts.GridColumnSt yles.Add(txtID5 )
>
> Dim txtID6 As New DataGridTextBox Column
> txtID6.MappingN ame = "Active"
> txtID6.HeaderTe xt = "Active"
> txtID6.Width = 80
> ts.GridColumnSt yles.Add(txtID6 )
>
> Dim txtID7 As New DataGridTextBox Column
> txtID7.MappingN ame = ""
> txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnSt yles.Add(txtID7 )
>
> DataGrid1.Table Styles.Clear()
> DataGrid1.Table Styles.Add(ts)
> Me.DataGrid1.Da taSource = ds.Tables(0)
>
>
> i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBox Column
> >
> > txtID.MappingNa me = "ID column name from database"
> >
> > txtID.HeaderTex t = "ID"
> >
> > txtID.Width = 50
> >
> > ts.GridColumnSt yles.Add(txtID)
> >
> > DataGrid1.Table Styles.Clear()
> > DataGrid1.Table Styles.Add(ts)
> > Me.DataGrid1.Da taSource = ds.Tables(0)
> >
> >
> > /Lars
> >
> > "Mike Fellows" <HYPERLINK
> >


"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.co
> > .uk> skrev i meddelandet
> > news:rf******** *****@newsfe1-gui.server.ntli .net...
>

> > > Ok,
> > >
> > > ive added my TableStyle (i think)
> > >
> > > Dim ts As New DataGridTableSt yle
> > > ts.MappingName = "Table"
> > > DataGrid1.Table Styles.Clear()
> > > DataGrid1.Table Styles.Add(ts)
> > > Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
>

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

> > want.
>

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


"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.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.Da taSource = 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$e M3.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 DataGridComboBo xColumn

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

earlier for the DataGridCheckBo xColumn 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 DataGridTextBox Column 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***@b ellsouth.net"vb ***@bellsouth.n et> wrote in message
news:ek******** ******@tk2msftn gp13.phx.gbl...
Hi,

That's it default behavior.


HYPERLINK
"http://msdn.microsoft. com/library/default.asp?url =/library/en-us/cpref/html
/frlrfSystemWind owsFormsDataGri dBoolColumnClas sTopic.asp"http ://msdn.microso
ft.com/library/default.asp?url =/library/en-us/cpref/html/frlrfSystemWind owsF
ormsDataGridBoo lColumnClassTop ic.asp

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

"Mike Fellows" <HYPERLINK
"mailto:mi***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o
.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***@b ellsouth.net"HY PERLINK
"mailto:vb***@b ellsouth.net"vb ***@bellsouth.n et> wrote in message
news:u7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
>
> Add a new column to your dataset. Add a datagridboolcol umn to
> your
> tablestyle.
>
> Dim dc As New DataColumn("MyB oolColumn", GetType(Boolean ))
> dc.DefaultValue = False
> ds.Tables("Tabl e").Columns.Add (dc)
>
> Dim txtID7 As New DataGridBoolCol umn
> txtID7.MappingN ame = "MyBoolColu mn"
> txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnSt yles.Add(txtID7 )
>
> Ken
> ------------------
>
> "Mike Fellows" <HYPERLINK
>
"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.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 DataGridTableSt yle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBox Column
> > txtID.MappingNa me = "ID"
> > txtID.HeaderTex t = "ID"
> > txtID.Width = 50
> > ts.GridColumnSt yles.Add(txtID)
> >
> > Dim txtID1 As New DataGridTextBox Column
> > txtID1.MappingN ame = "Postcode"
> > txtID1.HeaderTe xt = "Postcode"
> > txtID1.Width = 80
> > ts.GridColumnSt yles.Add(txtID1 )
> >
> > Dim txtID2 As New DataGridTextBox Column
> > txtID2.MappingN ame = "DistributionVo lume"
> > txtID2.HeaderTe xt = "Distributi on Volume"
> > txtID2.Width = 80
> > ts.GridColumnSt yles.Add(txtID2 )
> >
> > Dim txtID3 As New DataGridTextBox Column
> > txtID3.MappingN ame = "Distributo r"
> > txtID3.HeaderTe xt = "Distributo r"
> > txtID3.Width = 80
> > ts.GridColumnSt yles.Add(txtID3 )
> >
> > Dim txtID4 As New DataGridTextBox Column
> > txtID4.MappingN ame = "Frequency"
> > txtID4.HeaderTe xt = "Frequency"
> > txtID4.Width = 80
> > ts.GridColumnSt yles.Add(txtID4 )
> >
> > Dim txtID5 As New DataGridTextBox Column
> > txtID5.MappingN ame = "WeekCommencing "
> > txtID5.HeaderTe xt = "Week Commencing"
> > txtID5.Width = 80
> > ts.GridColumnSt yles.Add(txtID5 )
> >
> > Dim txtID6 As New DataGridTextBox Column
> > txtID6.MappingN ame = "Active"
> > txtID6.HeaderTe xt = "Active"
> > txtID6.Width = 80
> > ts.GridColumnSt yles.Add(txtID6 )
> >
> > Dim txtID7 As New DataGridTextBox Column
> > txtID7.MappingN ame = ""
> > txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> > txtID7.Width = 120
> > ts.GridColumnSt yles.Add(txtID7 )
> >
> > DataGrid1.Table Styles.Clear()
> > DataGrid1.Table Styles.Add(ts)
> > Me.DataGrid1.Da taSource = ds.Tables(0)
> >
> >
> > i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
> > > ts.MappingName = "Table"
> > >
> > > Dim txtID As New DataGridTextBox Column
> > >
> > > txtID.MappingNa me = "ID column name from database"
> > >
> > > txtID.HeaderTex t = "ID"
> > >
> > > txtID.Width = 50
> > >
> > > ts.GridColumnSt yles.Add(txtID)
> > >
> > > DataGrid1.Table Styles.Clear()
> > > DataGrid1.Table Styles.Add(ts)
> > > Me.DataGrid1.Da taSource = ds.Tables(0)
> > >
> > >
> > > /Lars
> > >
> > > "Mike Fellows" <HYPERLINK
> > >
"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK

"mailto:mi***** **********@equi tyhouse.co"HYPE RLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.co
> > .uk> skrev i meddelandet
> > > news:rf******** *****@newsfe1-gui.server.ntli .net...
> >
> > > Ok,
> > > >
> > > > ive added my TableStyle (i think)
> > > >
> > > > Dim ts As New DataGridTableSt yle
> > > > ts.MappingName = "Table"
> > > > DataGrid1.Table Styles.Clear()
> > > > DataGrid1.Table Styles.Add(ts)
> > > > Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
> >
> > > > You need to add a TableStyle to the Grid, including the
> > > > > Columns
> > > > > you
> >
> > want.
> >
> > > > Make the last Column you add to the style a
> > > > > DataGridCheckBo xColumn
> > > > >
> > > > > /Lars
> > > > >
> > > > >
> > > > > "Mike Fellows" <HYPERLINK
> > > > >
"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK

"mailto:mi***** **********@equi tyhouse.co"HYPE RLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.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.Da taSource = 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***@bellsout h.net> wrote in message
news:u7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Add a new column to your dataset. Add a datagridboolcol umn to your
tablestyle.

Dim dc As New DataColumn("MyB oolColumn", GetType(Boolean ))
dc.DefaultValue = False
ds.Tables("Tabl e").Columns.Add (dc)

Dim txtID7 As New DataGridBoolCol umn
txtID7.MappingN ame = "MyBoolColu mn"
txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnSt yles.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 DataGridTableSt yle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBox Column
txtID.MappingNa me = "ID"
txtID.HeaderTex t = "ID"
txtID.Width = 50
ts.GridColumnSt yles.Add(txtID)

Dim txtID1 As New DataGridTextBox Column
txtID1.MappingN ame = "Postcode"
txtID1.HeaderTe xt = "Postcode"
txtID1.Width = 80
ts.GridColumnSt yles.Add(txtID1 )

Dim txtID2 As New DataGridTextBox Column
txtID2.MappingN ame = "DistributionVo lume"
txtID2.HeaderTe xt = "Distributi on Volume"
txtID2.Width = 80
ts.GridColumnSt yles.Add(txtID2 )

Dim txtID3 As New DataGridTextBox Column
txtID3.MappingN ame = "Distributo r"
txtID3.HeaderTe xt = "Distributo r"
txtID3.Width = 80
ts.GridColumnSt yles.Add(txtID3 )

Dim txtID4 As New DataGridTextBox Column
txtID4.MappingN ame = "Frequency"
txtID4.HeaderTe xt = "Frequency"
txtID4.Width = 80
ts.GridColumnSt yles.Add(txtID4 )

Dim txtID5 As New DataGridTextBox Column
txtID5.MappingN ame = "WeekCommencing "
txtID5.HeaderTe xt = "Week Commencing"
txtID5.Width = 80
ts.GridColumnSt yles.Add(txtID5 )

Dim txtID6 As New DataGridTextBox Column
txtID6.MappingN ame = "Active"
txtID6.HeaderTe xt = "Active"
txtID6.Width = 80
ts.GridColumnSt yles.Add(txtID6 )

Dim txtID7 As New DataGridTextBox Column
txtID7.MappingN ame = ""
txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnSt yles.Add(txtID7 )

DataGrid1.Table Styles.Clear()
DataGrid1.Table Styles.Add(ts)
Me.DataGrid1.Da taSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBox Column
>
> txtID.MappingNa me = "ID column name from database"
>
> txtID.HeaderTex t = "ID"
>
> txtID.Width = 50
>
> ts.GridColumnSt yles.Add(txtID)
>
> DataGrid1.Table Styles.Clear()
> DataGrid1.Table Styles.Add(ts)
> Me.DataGrid1.Da taSource = ds.Tables(0)
>
>
> /Lars
>
> "Mike Fellows" <HYPERLINK
>

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

> > Ok,
> >
> > ive added my TableStyle (i think)
> >
> > Dim ts As New DataGridTableSt yle
> > ts.MappingName = "Table"
> > DataGrid1.Table Styles.Clear()
> > DataGrid1.Table Styles.Add(ts)
> > Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...

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

> want.

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

"mailto:mi***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o
> > > .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.Da taSource = 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*******@hotm ail.com> wrote in message
news:#V******** ******@TK2MSFTN GP10.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***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o
.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***@b ellsouth.net"vb ***@bellsouth.n et> wrote in message
news:u7******** ******@TK2MSFTN GP10.phx.gbl...

Hi,

Add a new column to your dataset. Add a datagridboolcol umn to your
tablestyle.

Dim dc As New DataColumn("MyB oolColumn", GetType(Boolean ))
dc.DefaultValue = False
ds.Tables("Tabl e").Columns.Add (dc)

Dim txtID7 As New DataGridBoolCol umn
txtID7.MappingN ame = "MyBoolColu mn"
txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnSt yles.Add(txtID7 )

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

"Mike Fellows" <HYPERLINK
"mailto:mi***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o
.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 DataGridTableSt yle
> ts.MappingName = "Table"
>
> Dim txtID As New DataGridTextBox Column
> txtID.MappingNa me = "ID"
> txtID.HeaderTex t = "ID"
> txtID.Width = 50
> ts.GridColumnSt yles.Add(txtID)
>
> Dim txtID1 As New DataGridTextBox Column
> txtID1.MappingN ame = "Postcode"
> txtID1.HeaderTe xt = "Postcode"
> txtID1.Width = 80
> ts.GridColumnSt yles.Add(txtID1 )
>
> Dim txtID2 As New DataGridTextBox Column
> txtID2.MappingN ame = "DistributionVo lume"
> txtID2.HeaderTe xt = "Distributi on Volume"
> txtID2.Width = 80
> ts.GridColumnSt yles.Add(txtID2 )
>
> Dim txtID3 As New DataGridTextBox Column
> txtID3.MappingN ame = "Distributo r"
> txtID3.HeaderTe xt = "Distributo r"
> txtID3.Width = 80
> ts.GridColumnSt yles.Add(txtID3 )
>
> Dim txtID4 As New DataGridTextBox Column
> txtID4.MappingN ame = "Frequency"
> txtID4.HeaderTe xt = "Frequency"
> txtID4.Width = 80
> ts.GridColumnSt yles.Add(txtID4 )
>
> Dim txtID5 As New DataGridTextBox Column
> txtID5.MappingN ame = "WeekCommencing "
> txtID5.HeaderTe xt = "Week Commencing"
> txtID5.Width = 80
> ts.GridColumnSt yles.Add(txtID5 )
>
> Dim txtID6 As New DataGridTextBox Column
> txtID6.MappingN ame = "Active"
> txtID6.HeaderTe xt = "Active"
> txtID6.Width = 80
> ts.GridColumnSt yles.Add(txtID6 )
>
> Dim txtID7 As New DataGridTextBox Column
> txtID7.MappingN ame = ""
> txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnSt yles.Add(txtID7 )
>
> DataGrid1.Table Styles.Clear()
> DataGrid1.Table Styles.Add(ts)
> Me.DataGrid1.Da taSource = ds.Tables(0)
>
>
> i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBox Column
> >
> > txtID.MappingNa me = "ID column name from database"
> >
> > txtID.HeaderTex t = "ID"
> >
> > txtID.Width = 50
> >
> > ts.GridColumnSt yles.Add(txtID)
> >
> > DataGrid1.Table Styles.Clear()
> > DataGrid1.Table Styles.Add(ts)
> > Me.DataGrid1.Da taSource = ds.Tables(0)
> >
> >
> > /Lars
> >
> > "Mike Fellows" <HYPERLINK
> >


"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.co
> .uk> skrev i meddelandet
> > news:rf******** *****@newsfe1-gui.server.ntli .net...
> > > Ok,
> > >
> > > ive added my TableStyle (i think)
> > >
> > > Dim ts As New DataGridTableSt yle
> > > ts.MappingName = "Table"
> > > DataGrid1.Table Styles.Clear()
> > > DataGrid1.Table Styles.Add(ts)
> > > Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
> > > > You need to add a TableStyle to the Grid, including the
> > > > Columns
> > > > you
> > want.
> > > > Make the last Column you add to the style a
DataGridCheckBo xColumn
> > >
> > > > /Lars
> > > >
> > > >
> > > > "Mike Fellows" <HYPERLINK
> > > >


"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.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.Da taSource = 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$e M3.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 DataGridComboBo xColumn

this does not exist as far as i can tell (this was the same as i was told
earlier for the DataGridCheckBo xColumn 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 DataGridTextBox Column 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***@bellsout h.net> wrote in message
news:ek******** ******@tk2msftn gp13.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***@b ellsouth.net"vb ***@bellsouth.n et> wrote in message
news:u7******** ******@TK2MSFTN GP10.phx.gbl...

> Hi,
>
> Add a new column to your dataset. Add a datagridboolcol umn to your
> tablestyle.
>
> Dim dc As New DataColumn("MyB oolColumn", GetType(Boolean ))
> dc.DefaultValue = False
> ds.Tables("Tabl e").Columns.Add (dc)
>
> Dim txtID7 As New DataGridBoolCol umn
> txtID7.MappingN ame = "MyBoolColu mn"
> txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnSt yles.Add(txtID7 )
>
> Ken
> ------------------
>
> "Mike Fellows" <HYPERLINK
>

"mailto:mi***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o
> .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 DataGridTableSt yle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBox Column
> > txtID.MappingNa me = "ID"
> > txtID.HeaderTex t = "ID"
> > txtID.Width = 50
> > ts.GridColumnSt yles.Add(txtID)
> >
> > Dim txtID1 As New DataGridTextBox Column
> > txtID1.MappingN ame = "Postcode"
> > txtID1.HeaderTe xt = "Postcode"
> > txtID1.Width = 80
> > ts.GridColumnSt yles.Add(txtID1 )
> >
> > Dim txtID2 As New DataGridTextBox Column
> > txtID2.MappingN ame = "DistributionVo lume"
> > txtID2.HeaderTe xt = "Distributi on Volume"
> > txtID2.Width = 80
> > ts.GridColumnSt yles.Add(txtID2 )
> >
> > Dim txtID3 As New DataGridTextBox Column
> > txtID3.MappingN ame = "Distributo r"
> > txtID3.HeaderTe xt = "Distributo r"
> > txtID3.Width = 80
> > ts.GridColumnSt yles.Add(txtID3 )
> >
> > Dim txtID4 As New DataGridTextBox Column
> > txtID4.MappingN ame = "Frequency"
> > txtID4.HeaderTe xt = "Frequency"
> > txtID4.Width = 80
> > ts.GridColumnSt yles.Add(txtID4 )
> >
> > Dim txtID5 As New DataGridTextBox Column
> > txtID5.MappingN ame = "WeekCommencing "
> > txtID5.HeaderTe xt = "Week Commencing"
> > txtID5.Width = 80
> > ts.GridColumnSt yles.Add(txtID5 )
> >
> > Dim txtID6 As New DataGridTextBox Column
> > txtID6.MappingN ame = "Active"
> > txtID6.HeaderTe xt = "Active"
> > txtID6.Width = 80
> > ts.GridColumnSt yles.Add(txtID6 )
> >
> > Dim txtID7 As New DataGridTextBox Column
> > txtID7.MappingN ame = ""
> > txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> > txtID7.Width = 120
> > ts.GridColumnSt yles.Add(txtID7 )
> >
> > DataGrid1.Table Styles.Clear()
> > DataGrid1.Table Styles.Add(ts)
> > Me.DataGrid1.Da taSource = ds.Tables(0)
> >
> >
> > i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
> > > ts.MappingName = "Table"
> > >
> > > Dim txtID As New DataGridTextBox Column
> > >
> > > txtID.MappingNa me = "ID column name from database"
> > >
> > > txtID.HeaderTex t = "ID"
> > >
> > > txtID.Width = 50
> > >
> > > ts.GridColumnSt yles.Add(txtID)
> > >
> > > DataGrid1.Table Styles.Clear()
> > > DataGrid1.Table Styles.Add(ts)
> > > Me.DataGrid1.Da taSource = ds.Tables(0)
> > >
> > >
> > > /Lars
> > >
> > > "Mike Fellows" <HYPERLINK
> > >

"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.co
> > > .uk> skrev i meddelandet
> > > news:rf******** *****@newsfe1-gui.server.ntli .net...
> >

> > > > Ok,
> > > >
> > > > ive added my TableStyle (i think)
> > > >
> > > > Dim ts As New DataGridTableSt yle
> > > > ts.MappingName = "Table"
> > > > DataGrid1.Table Styles.Clear()
> > > > DataGrid1.Table Styles.Add(ts)
> > > > Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
> >

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

> > > want.
> >

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

"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.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.Da taSource = 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***@bellsout h.net> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl...
Hi,

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

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

"Ali baba the 40th" <al*******@hotm ail.com> wrote in message
news:#V******** ******@TK2MSFTN GP10.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***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o .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***@b ellsouth.net"vb ***@bellsouth.n et> wrote in message
news:u7******** ******@TK2MSFTN GP10.phx.gbl...

> Hi,
>
> Add a new column to your dataset. Add a datagridboolcol umn to your
> tablestyle.
>
> Dim dc As New DataColumn("MyB oolColumn", GetType(Boolean ))
> dc.DefaultValue = False
> ds.Tables("Tabl e").Columns.Add (dc)
>
> Dim txtID7 As New DataGridBoolCol umn
> txtID7.MappingN ame = "MyBoolColu mn"
> txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> txtID7.Width = 120
> ts.GridColumnSt yles.Add(txtID7 )
>
> Ken
> ------------------
>
> "Mike Fellows" <HYPERLINK
> "mailto:mi***** **********@equi tyhouse.co.uk"m i************** *@equityhouse.c o > .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 DataGridTableSt yle
> > ts.MappingName = "Table"
> >
> > Dim txtID As New DataGridTextBox Column
> > txtID.MappingNa me = "ID"
> > txtID.HeaderTex t = "ID"
> > txtID.Width = 50
> > ts.GridColumnSt yles.Add(txtID)
> >
> > Dim txtID1 As New DataGridTextBox Column
> > txtID1.MappingN ame = "Postcode"
> > txtID1.HeaderTe xt = "Postcode"
> > txtID1.Width = 80
> > ts.GridColumnSt yles.Add(txtID1 )
> >
> > Dim txtID2 As New DataGridTextBox Column
> > txtID2.MappingN ame = "DistributionVo lume"
> > txtID2.HeaderTe xt = "Distributi on Volume"
> > txtID2.Width = 80
> > ts.GridColumnSt yles.Add(txtID2 )
> >
> > Dim txtID3 As New DataGridTextBox Column
> > txtID3.MappingN ame = "Distributo r"
> > txtID3.HeaderTe xt = "Distributo r"
> > txtID3.Width = 80
> > ts.GridColumnSt yles.Add(txtID3 )
> >
> > Dim txtID4 As New DataGridTextBox Column
> > txtID4.MappingN ame = "Frequency"
> > txtID4.HeaderTe xt = "Frequency"
> > txtID4.Width = 80
> > ts.GridColumnSt yles.Add(txtID4 )
> >
> > Dim txtID5 As New DataGridTextBox Column
> > txtID5.MappingN ame = "WeekCommencing "
> > txtID5.HeaderTe xt = "Week Commencing"
> > txtID5.Width = 80
> > ts.GridColumnSt yles.Add(txtID5 )
> >
> > Dim txtID6 As New DataGridTextBox Column
> > txtID6.MappingN ame = "Active"
> > txtID6.HeaderTe xt = "Active"
> > txtID6.Width = 80
> > ts.GridColumnSt yles.Add(txtID6 )
> >
> > Dim txtID7 As New DataGridTextBox Column
> > txtID7.MappingN ame = ""
> > txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
> > txtID7.Width = 120
> > ts.GridColumnSt yles.Add(txtID7 )
> >
> > DataGrid1.Table Styles.Clear()
> > DataGrid1.Table Styles.Add(ts)
> > Me.DataGrid1.Da taSource = ds.Tables(0)
> >
> >
> > i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
> > > ts.MappingName = "Table"
> > >
> > > Dim txtID As New DataGridTextBox Column
> > >
> > > txtID.MappingNa me = "ID column name from database"
> > >
> > > txtID.HeaderTex t = "ID"
> > >
> > > txtID.Width = 50
> > >
> > > ts.GridColumnSt yles.Add(txtID)
> > >
> > > DataGrid1.Table Styles.Clear()
> > > DataGrid1.Table Styles.Add(ts)
> > > Me.DataGrid1.Da taSource = ds.Tables(0)
> > >
> > >
> > > /Lars
> > >
> > > "Mike Fellows" <HYPERLINK
> > >



"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.co
> > > .uk> skrev i meddelandet
> > > news:rf******** *****@newsfe1-gui.server.ntli .net...
> >

> > > > Ok,
> > > >
> > > > ive added my TableStyle (i think)
> > > >
> > > > Dim ts As New DataGridTableSt yle
> > > > ts.MappingName = "Table"
> > > > DataGrid1.Table Styles.Clear()
> > > > DataGrid1.Table Styles.Add(ts)
> > > > Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
> >

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

> > > want.
> >

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


DataGridCheckBo xColumn
> > > > >
> > > > > /Lars
> > > > >
> > > > >
> > > > > "Mike Fellows" <HYPERLINK
> > > > >



"mailto:mi***** **********@equi tyhouse.co.uk"H YPERLINK
"mailto:mi***** **********@equi tyhouse.co"mi** *************@e quityhouse.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.Da taSource = 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.Sql ServerCe.SqlCeC onnection("Data Source=\my
documents\NWIND _CE.sdf;passwor d=ahd")

Dim cmd1 As New SqlCeCommand
Dim dr1 As SqlCeDataReader
Try
cn1.Open()
cmd1.CommandTex t = "select
acct_number,acc t_name,acct_ibu ,acct_group from CMF"
cmd1.Connection = cn1
dr1 = cmd1.ExecuteRea der

Me.DataGrid1.Da taSource = 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 DataGridTableSt yle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBox Column
txtID.MappingNa me = "ID"
txtID.HeaderTex t = "ID"
txtID.Width = 50
ts.GridColumnSt yles.Add(txtID)

Dim txtID1 As New DataGridTextBox Column
txtID1.MappingN ame = "Postcode"
txtID1.HeaderTe xt = "Postcode"
txtID1.Width = 80
ts.GridColumnSt yles.Add(txtID1 )

Dim txtID2 As New DataGridTextBox Column
txtID2.MappingN ame = "DistributionVo lume"
txtID2.HeaderTe xt = "Distributi on Volume"
txtID2.Width = 80
ts.GridColumnSt yles.Add(txtID2 )

Dim txtID3 As New DataGridTextBox Column
txtID3.MappingN ame = "Distributo r"
txtID3.HeaderTe xt = "Distributo r"
txtID3.Width = 80
ts.GridColumnSt yles.Add(txtID3 )

Dim txtID4 As New DataGridTextBox Column
txtID4.MappingN ame = "Frequency"
txtID4.HeaderTe xt = "Frequency"
txtID4.Width = 80
ts.GridColumnSt yles.Add(txtID4 )

Dim txtID5 As New DataGridTextBox Column
txtID5.MappingN ame = "WeekCommencing "
txtID5.HeaderTe xt = "Week Commencing"
txtID5.Width = 80
ts.GridColumnSt yles.Add(txtID5 )

Dim txtID6 As New DataGridTextBox Column
txtID6.MappingN ame = "Active"
txtID6.HeaderTe xt = "Active"
txtID6.Width = 80
ts.GridColumnSt yles.Add(txtID6 )

Dim txtID7 As New DataGridTextBox Column
txtID7.MappingN ame = ""
txtID7.HeaderTe xt = "CHECKBOX HERE PLEASE"
txtID7.Width = 120
ts.GridColumnSt yles.Add(txtID7 )

DataGrid1.Table Styles.Clear()
DataGrid1.Table Styles.Add(ts)
Me.DataGrid1.Da taSource = ds.Tables(0)
i dont seem to be able to add the DataGridCheckBo xColumn 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******** *****@TK2MSFTNG P11.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 DataGridTableSt yle
ts.MappingName = "Table"

Dim txtID As New DataGridTextBox Column

txtID.MappingNa me = "ID column name from database"

txtID.HeaderTex t = "ID"

txtID.Width = 50

ts.GridColumnSt yles.Add(txtID)

DataGrid1.Table Styles.Clear()
DataGrid1.Table Styles.Add(ts)
Me.DataGrid1.Da taSource = 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 DataGridTableSt yle
ts.MappingName = "Table"
DataGrid1.Table Styles.Clear()
DataGrid1.Table Styles.Add(ts)
Me.DataGrid1.Da taSource = 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******** **********@TK2M SFTNGP11.phx.gb l...
> You need to add a TableStyle to the Grid, including the Columns you

want.
> Make the last Column you add to the style a DataGridCheckBo xColumn
>
> /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.Da taSource = 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2640
by: Jean Carlo | last post by:
Hello guys I`m developing a windows form that contain one Datagrid. In this datagrid I insert a checkBox Column. I need to get all rows where checkbox is checked by user. How do I get this rows ? I can´t use the DataSource of Datagrid because I don´t have a Column source for checkBox in my DataSource. Is there any method in datagrid to loop in datagrid rows ?
2
3152
by: Sebi | last post by:
Hello all is it possible to add a checkbox in a DataGrid for Boolean Data? Thanks in advance
0
2406
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a CheckBox Programmatically" in my code. I have changed it to use a OLDDB.DBReader to populate the datagrid and for the databinding. It works perfectly - also when using the edit-mode in the datagrid.
4
1853
by: Mike | last post by:
Hi, Is there a possibility to have one of the Web Control Datagrid's column as a Calendar when editing data? Any resources on this subject? Thanks Mike
2
2465
by: Mortar | last post by:
i have a datagrid with 2 columns. the 1st column contains an id which will be used by the database for the selected checkbox records. the 2nd column is a template column containing a server checkbox control. where i'm at: i can retrieve a count of the selected checkboxes, but don't know how to get the related id's (in the 1st column).
10
2446
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox control in a datagrid? Now I have a Select column but the problem is that the user needs to select more than one record and send them all to print, instead of being one by one like is now with the Select column. Another question, is it possible to...
9
3190
by: tshad | last post by:
I have a datagrid that I want to add a new column to. This column will only be visible under certain conditions. So I want to set the column visible=false. Then when the right condition happens to change it to visible=true. You can't do that with a bound column (no ID), but you can create a templatecolumn with a label. To make these visible, I am going through each datagriditem and making them visible after I have bound the data to...
1
4237
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get the example to work. I created the following two classes, provided with the example: *-*-**-*-*-*-*-*-*-*-*-*-**-*-*-*-*-CheckBoxColumn Class:-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-**-*-*-*
9
1595
by: Rekha | last post by:
The data is filled in datagrid. I want to know how to add a checkbox column in datagrid? In the runtime, checkbox is checked then instead of checkbox value the (caseID )column value is retained. I know there is a lot of article on datagrid with checkbox but nothing helped me . Can anyone help me how to proceed ? Thanks
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.