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 17 7407
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
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
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
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
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 > >
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
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
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
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
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
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
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
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
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
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
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
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 > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: Sebi |
last post by:
Hello all
is it possible to add a checkbox in a DataGrid for
Boolean Data?
Thanks in advance
|
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...
|
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
|
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...
|
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...
|
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...
|
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...
|
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....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
|
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...
|
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...
|
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...
| |