RichardAtherton
Apr 1st, 2002, 05:55 PM
I've created my own tablestyle and columnstyles for some data I'm both displaying and editing in a datagrid.
to format the data the way I want I've created my own DataGridTextBoxColumn and since this is numeric data I wanted to use the textalign right property, however even though I code it like this:
Dim Qty As New DataGridTextBoxColumn()
Qty.MappingName = "Qty"
Qty.HeaderText = "Qty"
Qty.TextBox.MaxLength = 3
Qty.TextBox.TextAlign = HorizontalAlignment.Right
Qty.Format() = "#0"
Qty.Width = 40
Qty.NullText = ""
ts1.GridColumnStyles.Add(Qty)
DataGrid1.TableStyles.Add(ts1)
the insert cursor stubbornly styays on the left!!! not the right as I wnanted
can anyone see anything wrong with my coding, I know the datagridtextbox inherits from the textbox and it's exactly the same property I use for a textbox and that works fine.
to format the data the way I want I've created my own DataGridTextBoxColumn and since this is numeric data I wanted to use the textalign right property, however even though I code it like this:
Dim Qty As New DataGridTextBoxColumn()
Qty.MappingName = "Qty"
Qty.HeaderText = "Qty"
Qty.TextBox.MaxLength = 3
Qty.TextBox.TextAlign = HorizontalAlignment.Right
Qty.Format() = "#0"
Qty.Width = 40
Qty.NullText = ""
ts1.GridColumnStyles.Add(Qty)
DataGrid1.TableStyles.Add(ts1)
the insert cursor stubbornly styays on the left!!! not the right as I wnanted
can anyone see anything wrong with my coding, I know the datagridtextbox inherits from the textbox and it's exactly the same property I use for a textbox and that works fine.