Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit DataGrid AutoGenerated Column TextAlignment
3 replies. Latest Post by realdn on July 2, 2009.
(0)
realdn
Member
8 points
12 Posts
07-02-2009 4:01 AM |
HI,
I want to set the TextAlignment of a Autogenarated Column. Is it Possible?
lingbing
Contributor
2249 points
406 Posts
07-02-2009 4:28 AM |
Hi, you can change the DataGrid's CellStyle to let the content display at where you want. It will be like:
<Grid> <Grid.Resource> <Style x:Key="MyStyle" TargetType="data:DataGridCell"> <Setter Property="HorizontalContentAlignment" Value="Right"/> </Style> </Grid.Resource> <data:DataGrid CellStyle="{StaticResource MyStyle}"/></Grid>
You can have a try and tell me the result. Regards!
jay nana...
3388 points
624 Posts
You should read this article:
http://msdn.microsoft.com/en-us/library/cc903950(VS.95).aspx
07-02-2009 4:37 AM |
thanx lingbing, it works fine. and also thanx to Nanavaty for the link.