I need to align the values inside the Grid View to to Center and Right. Because I need to align Currency.
And other Columns need to be aligned Center and Left.
Can you Help me doing This??
I'm currently Doing This.
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Amount">
<ItemTemplate>Rs.<%# Eval("Payable_Bill_Amount","{0:n}")%></ItemTemplate>
</asp:TemplateField>
This Aligns the Content to totally Right. I need to align the Content to Right But Also to Center Like Calculations We Do
Ex:
Required Current
| 10.00 | | 10.00|
| 110.00 | | 110.00|
| 1210.00 | | 1210.00|
----------
Select the cells that have the text you want aligned. To horizontally align text, pick Align Text Left , Center , or Align Text Right . When you have a long line of text, part of the text might not be visible. To fix this without changing the column width, click Wrap Text.
Aligning items on the Block Axis. The align-self and align-items properties control alignment on the block axis. When we use these properties, we are changing the alignment of the item within the grid area you have placed it.
For aligning columns to the left, the align-content property will set to 'flex-start'. For aligning columns to the right, the align-content property will set to 'flex-end'. For aligning columns to the extreme ends, the align-content property will set to 'space-between'.
One of the easiest ways of centering the content of grid items is using Flexbox. Set the display to "grid" for the grid container, and "flex" for grid items. Then, add the align-items and justify-content properties, both with the "center" value, to grid items.
How about aligning them to the right using
ItemStyle-HorizontalAlign="Right"
and then using CSS padding to add some space around the edge of the value in the cell?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With