This Syntax from the old UltraWebGrid:
UltraWebGrid1.Columns.FromKey("Betrag").CellStyle.HorizontalAlign=HorizontalAlign.Right
How is the systax in the WebDataGrid?Thanks.
Hi BBL_MV,
There is no property to do this for the WebDataGrid. This would be accomplished with styling. You would need to set the css of the column to a class that aligns the text on the right. You would also have to do this to the header css and footer css and any auxilary row cells.
regards,David Young
My Inline CSS in Page1.ASPX:<style type="text/css">.rechts {text-align:right;}</style>
My WedDataGrid Code:Dim neueSpalte As New Infragistics.Web.UI.GridControls.BoundDataFieldneueSpalte.Header.CssClass = "rechts" '<--- work fineneueSpalte.CssClass = "rechts" '<-- Do nothingI can align the ColumnHeader, but not the Value in the Grid.Why?
There are actually a bunch of previous forum posts about this. The problem is that for the cells the css you have is ignored unless you provide css selectors similar to what is in the default styles. Try
tbody > tr > td.RAlign
But only use that for the cells. The one you have should work fine for the header.
-Dave
Not possible a column is to be positioned right.
My new Inline CSS in Page1.ASPX:<style type="text/css">
.rechts {tbody > tr > td.RAlign}</style>
It does not function.Please, post a Link, if there is already a solution. Thanks!
You need two styles.
.rechts{
text-align: right;
}
{
You assign Rects to the header css and RAlign to the column css that goes to the cells.
Thanks. This work fine.Great.
So the entire formatting of the grid is CSS? I was eval'ing the controld. That fixed it for me. We won't be buying this grid.
I love CSS, but I don't want to have to go change it for something as simple as right aligning a column or a cell.