Hi,
args.Row.Cells["ParameterValue"].Appearance.TextHAlignAsString = "Center"
but it does not seem to work.
regards
Stefan
thanks for your quick reply.
Actually what I am doing is following. I have a Column of the type of String but in the database it is stored in different types:
The DB Table has fields boolvalue as bool, intvalue as int, .... When filling the dataset I convert them to String so I can show it in the grid and I have a second field which holds the display type e.g. "BOOL". The boolvalue becomes "TRUE" or "FALSE". On the initializeRow Event I change the EditorControl of the Cell to CheckboxControl if the datatype field has the value of "BOOL" so it can show as a checkbox. The cool thing is I actually get a checkbox if the Value is the string "TRUE" or "FALSE". BUT the checkbox is not centered.
This may seem strange but maybe you know a better way of having different fields of a dataset in the same column.
For your understanding :
DB Table Fields: ParaValueInt as int, ParaValueBool as BOOL, ParaValueString as VARCHAR, DataType AS VARCHAR.....
Dataset Fields: ParaValue AS String, Datatype AS String --> Depending on the value of DataType in the DB Table I fill the field ParaValue in the Dataset.
What I actually would need is the possibility to display different fields in one colomn, so this is my workaround,
HI Stefan,
TextAlign doesn't work because a checkbox is not text. :)
Anyway, though...CheckBoxes in the grid are centered by default. So how are you creating your checkbox column so that it's NOT centered?