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;
I figured out why this is not working as it is supposed to work, but I became inundated with other development tasks and simply forgot to post the fix.
I searched the Infragistics documentation and found that the order CSS classes can adversely affect some settings. Upon learning this, I changed the order of my classes in the CSS file I distribute with my web pages and it fixed the problem.
If anyone out there is experiencing this same behavior, try switching the order of your classes that affect the webgrid to see if it helps. This isn't the first time I've discovered something buried deep in the bowels of Infragistics documentation.
I just spent a good hour doing the same thing - checking that there isn't a "text-align: left" attribute in my CSS classes that would destroy the alignment and there isn't. I do remember setting the HorizontalAlign property to Right and that being that, but all of a sudden I also get all columns aligned to left. Strange thing.