Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
text alignment not working in webgrid columns
posted

I have a webgrid (Infragisitics UltraWebgrid v7.3.20073.1043) that has the horizontal alignment for a column set to right. The data in the column is left aligned. I'm not sure why this stopped working as it has always worked in the past.

 I've checked the CSS class I assign to the rows to make sure there is no text-align attribute, which there is not. Has anyone experienced this? If so, how can I fix it? Any help would be appreciated.

BTW, here is the block of code for the column from the IntializeLayout event:

    Infragistics.WebUI.UltraWebGrid.UltraGridColumn gcCol = e.Layout.Bands[0].Columns.FromKey("AvailCrewCnt");
    gcCol.Header.Caption = "Available Crew Members";
    gcCol.Header.Style.VerticalAlign = VerticalAlign.Middle;
    gcCol.Header.Style.HorizontalAlign = HorizontalAlign.Center;
    gcCol.CellStyle.Padding.Left = new Unit(3);
    gcCol.CellStyle.Padding.Right = new Unit(3);
    gcCol.Width = new Unit(20, UnitType.Percentage);
    gcCol.Hidden = false;
    gcCol.Format = "";
    gcCol.Header.Style.Height = 20;
    gcCol.CellStyle.Wrap = false;
    gcCol.CellStyle.HorizontalAlign = HorizontalAlign.Right;
    gcCol.CellStyle.BackColor = Color.Transparent;