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 enter image description here

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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -