Write a program to control the column width, height and alignment of DataGrid
Write a program to control the column width, height and alignment of DataGrid?
- DataGrid control has the control over the rows and columns sizes that fits the height and width of the grid.
- AutoGenerateColumns property has to be False to control the column characteristics and it doesn’t let the column to generate automatically.
- The column width can be created using the style element for a particular column. It can also set the width of the element. The property can be set like:
<asp:BoundColumn DataField="title" SortExpression="title"
HeaderText="Title">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn>