asp.net - Auto-Size Columns In DataGrid -
this html grid, how can set columns auto-fit 1 column not huge when not needed? know can manually set size, rather auto-size store names longer others , manager names longer others pre-determined size isn't option.
<asp:datagrid runat="server" id="dtgmain" autogeneratecolumns="false" cssclass="datagrids" gridlines="both" showfooter="true" onitemcommand="dtgmain_onitemcommand"> <itemstyle cssclass="row" /> <footerstyle cssclass="datagridfooters" /> <headerstyle cssclass="datagridheaders" /> <columns> <asp:boundcolumn datafield="storename" headertext="storename"></asp:boundcolumn> <asp:boundcolumn datafield="hours" headertext="hours"></asp:boundcolumn> <asp:boundcolumn datafield="date" headertext="today's date" dataformatstring="{0:d}"></asp:boundcolumn> <asp:boundcolumn datafield="manager" headertext="store manager"></asp:boundcolumn> <asp:boundcolumn datafield="owner" headertext="store owner"></asp:boundcolumn> </columns> </asp:datagrid>
i thought auto-size default..
try: itemstyle-width="auto"
Comments
Post a Comment