dhoni kholi

dhoni kholi

  • NA
  • 198
  • 42.7k

How to add one column in Gridview

Dec 28 2019 6:21 AM
How to Add dynamically One column in Gridview for Barcode
 
  1. <div id="gridContainer" style="overflow: scroll">  
  2.              <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"   
  3.                  CssClass="myGrid" AlternatingRowStyle-CssClass="alt" CellPadding="3"   
  4.                  AllowPaging="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"   
  5.                  BorderWidth="1px" DataSourceID="dsProduct" Width="1019px"   
  6.                   Font-Names="Arial" onrowdatabound="GridView1_RowDataBound">  
  7.               <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>  
  8.                  <Columns>  
  9.                      <asp:BoundField DataField="id" HeaderText="Id" InsertVisible="False"   
  10.                          ReadOnly="True" SortExpression="id" />  
  11.                      <asp:BoundField DataField="pname" HeaderText="Name"   
  12.                          SortExpression="pname" />  
  13.                      <asp:BoundField DataField="subhead" HeaderText="Code"   
  14.                          SortExpression="subhead" />  
  15.                      <asp:BoundField DataField="hsn" HeaderText="HSN" SortExpression="hsn" />  
  16.                      <asp:BoundField DataField="qty" HeaderText="Quantity" SortExpression="qty" />  
  17.                      <asp:BoundField DataField="cprice" HeaderText="Price" SortExpression="cprice" />  
  18.                      <asp:BoundField DataField="tax" HeaderText="Tax %" SortExpression="tax" />  
  19.                      <asp:HyperLinkField HeaderText="Action" Text="Edit / Delete" />  
  20.                  </Columns>  
  21.                  <FooterStyle BackColor="White" ForeColor="Black" />  
  22.                  <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" />  
  23.                  <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Right" />  
  24.                  <RowStyle ForeColor="#000066" />  
  25.                  <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />  
  26.                  <SortedAscendingCellStyle BackColor="#F1F1F1" />  
  27.                  <SortedAscendingHeaderStyle BackColor="#007DBB" />  
  28.                  <SortedDescendingCellStyle BackColor="#CAC9C9" />  
  29.                  <SortedDescendingHeaderStyle BackColor="#00547E" />  
  30.                 </asp:GridView>  
  31.                
  32.               
  33.                         <asp:SqlDataSource ID="dsProduct" runat="server"   
  34.                   ConnectionString="<%$ ConnectionStrings:dbcon1 %>"   
  35.                   SelectCommand="SELECT [id], [pname], [subhead], [qty], [cprice], [hsn], [tax] FROM [offset]">  
  36.               </asp:SqlDataSource>  
  37.                
  38.               
  39.                         <asp:Button ID="btnreport" runat="server" Text="Report" CssClass="btn-primary mar"   
  40.                             width="105px" />  
  41.          </div>  
 How to add new column Dynamically for Bardcode in after Tax column ; Barcode Generated by code 
 
 
 

Answers (3)