darrenwild
New Member
I have the following piece of code. I did not define any boundfields in my gridview. I am retrieving data using sql queries in my aspx.cs file instead. Is it possible to adjust the width of each column 0, 1, 2? Are there any ways that I can look into? I have tried a lot of ways but it is still not working. Please help! \[code\]<asp:GridView ID="surgicalGridView" runat="server" CaptionAlign="Top" HorizontalAlign="Justify" DataKeyNames="id" onselectedindexchanged="surgicalGridView_SelectedIndexChanged" ToolTip="Excel File Download Tool" CellPadding="4" ForeColor="#333333" GridLines="None" Width="854px"> <RowStyle BackColor="#E3EAEB" /> <Columns> <asp:CommandField ShowSelectButton="True" SelectText="Download" ControlStyle-ForeColor="Blue"><ControlStyle ForeColor="Blue"></ControlStyle> </asp:CommandField> </Columns> <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#7C6F57" /> <AlternatingRowStyle BackColor="White" /> <SortedAscendingCellStyle BackColor="#F8FAFA" /> <SortedAscendingHeaderStyle BackColor="#246B61" /> <SortedDescendingCellStyle BackColor="#D4DFE1" /> <SortedDescendingHeaderStyle BackColor="#15524A" /> </asp:GridView> <br />\[/code\]