Never mind, I figure it out, it is the "HorizontalAlign" that I should set.
Thanks.
zheng
>
Thanks, Haneef, that works perfect for me. Now I have one more thing to seek the expert's advice.
The double value in my grid column kept showing right aligned in the cell even after I set the styleinfo.gridtextalign to left.
I noticed that in your sample, the double values do show up left aligned, do you know what I might be missing here?
Thanks.
zheng
>Hi Zheng,
If the columns in your DataBase schema are set to numerical type, then the grid should atomatically pick up the proper GridBoundColumn.StyleInfo.CellValueType.
But you will have to set GridBoundColumn.StyleInfo.Format for the columns where you want to see the formatted values. If you have explicitly added GridBoundColumns to the grid.GridBoundColumns collection (either from the designer or within your own code), then you can set the Format property either in teh designer or in your code.
If you have not added GridBoundColumns, then you can use the grid.Binder.InternalColumns collection to set the Format property from within your code after you have set the grid.DataSource property (which creates the grid.Binder.internalColumns collection).
Here is a kb article discussing setting the BackColor property on a column. To set the Format property, you would do something similar.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=85If you just don’t want to be able to focus on cells , you could consider using GridBoundColumn.StyleInfo.Clickable property . This way,grid cell ignoring the focus. This may make things behave better.
Best regards,
Haneef