why does gridview create two colums when gridview columns are bound in aspx page -
i have declared gridview in aspx page follows:
<tr> <td class="columndata"colspan="2"> <asp:gridview id="grddataview" runat="server"> <columns> <asp:boundfield datafield="divisionname" headertext="division name"/> <asp:boundfield datafield="designation" headertext="designation"/> <asp:boundfield datafield="noofemployee" headertext="no of employee"/> </columns> </asp:gridview> </td> </tr>
i bound gridview in button click follows:
grddataview.datasource = dt; grddataview.databind();
where dt contains column name divisionname,designation , noofemployee. shows me following output
i need avoid second group of column in black rectangular box. how can done?
you need set property "autogeneratecolumns" "false".
<asp:gridview id="grddataview" runat="server" autogeneratecolumns="false">
or else generate columns automatically along columns specify in code.
Comments
Post a Comment