I am using ASP Data Grid I am binding a data field, the title of the text dynamically through the code behind (C #).
I also dynamically adjust the column style, everything works fine, but one of the Horizontal-align.Center columns does not work.
I checked if the style is canceled, but that is not ...
This block of code gives the problem:
BoundField field4 = new BoundField(); field4.DataField = dtdata.Tables[0].Columns["data"].ToString(); field4.HeaderText = "Percentage%"; field4.DataFormatString = "{0:N1}%"; field4.SortExpression = "data"; field4.ItemStyle.HorizontalAlign = HorizontalAlign.Center; grdMarginGrid.Columns.Add(field4);
Can someone help me in recognizing where the problem is.
Thanks in advance, Divya.
source share