2012-05-05 18 views
1

私は8列のうち、ラジオボタンで覆われた4列のグリッドを持っています。 各列を間隔で均等に分割したいですが、うまくいかない? 私は何をすべき??/各列の等間隔でgridviewを分割する方法

<asp:GridView ID="gvRelatives" runat="server" AutoGenerateColumns="False" EmptyDataText="Sorry, No Records Available !" CellPadding="4" ForeColor="#333333" GridLines="None" CellSpacing ="2" onselectedindexchanged="gvRelatives_SelectedIndexChanged" AutoPostBack="True" onrowcreated="gvRelatives_RowCreated"       onrowdatabound="gvRelatives_RowDataBound" BorderWidth ="2" 
ondatabound="gvRelatives_DataBound" EnableSortingAndPagingCallbacks="False" > 
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> 
<RowStyle BackColor="#EFF3FB" HorizontalAlign="center" /> 
<Columns> 
<%--<asp:BoundField DataField="QTN_NO" HeaderText="Question Number" SortExpression="Name" InsertVisible ="false" />--%> 
<asp:BoundField DataField="QTN_DESC" HeaderText="Question Description" SortExpression="Name" InsertVisible ="false" /> 
<asp:BoundField DataField="SQTN_NO" HeaderText="Sub Question No" SortExpression="Name" /> 
<asp:BoundField DataField="SQTN_DESC" HeaderText="Sub Question Name" SortExpression="Name" /> 
<asp:TemplateField HeaderText ="Strongly Disagree"></asp:TemplateField> 
<asp:TemplateField HeaderText ="Disagree"></asp:TemplateField> 
<asp:TemplateField HeaderText ="Agree"></asp:TemplateField> 
<asp:TemplateField HeaderText ="Strongly Agree"></asp:TemplateField> 
</Columns> 
<asp:GridView> 
+0

が... – ray

答えて

1

は、各ヘッダーBoundField要素に幅を追加し、各分野で

 <asp:BoundField DataField="QTN_NO" HeaderText="Question Number" SortExpression="Name" Width="100px" InsertVisible ="false"/> 
+0

おかげで答えるFR GridViewの上CELLSPACINGとCELLPADDINGを適用することが...その..insteadを動作しませんでした、私はGridViewの...窓自動サイズ調整を設定しようとしたアイテムは自動的に同じサイズを取得します – Niks

1

を幅の値を入れてみてください。

<asp:BoundField DataField="Title" HeaderText="Title"> 
<HeaderStyle HorizontalAlign="Center" Width="400"></HeaderStyle> 
</asp:BoundField>` 
関連する問題