Assigning a RecID field to Gridview TemplateField (Checbox column)

Posted by user279521 on Stack Overflow See other posts from Stack Overflow or by user279521
Published on 2010-06-11T15:30:48Z Indexed on 2010/06/11 15:32 UTC
Read the original article Hit count: 332

Filed under:
|
|
|

I want to assign a RecID to the checkbox column "cbPOID". The RecID field that is being returned in my dataset, but should not be displayed in the gridview.

<asp:GridView ID="gvOrders" runat="server" AutoGenerateColumns="False" CellPadding="4" GridLines="None" Width="100%" AllowPaging="True" PageSize="20"     
                    onpageindexchanging="gvOrders_PageIndexChanging" ForeColor="#333333">    
    <Columns>    
        <asp:TemplateField HeaderText="VerifiedComplete" >    
            <ItemTemplate>    
                            <asp:CheckBox ID="cbPOID" runat="server"/>    
                    </ItemTemplate>    
                </asp:TemplateField>    
                <asp:BoundField DataField="PurchaseOrderID" HeaderText="PurchaseOrderID" HtmlEncode="False" ></asp:BoundField>    
                <asp:BoundField DataField="VENDOR_ID" HeaderText="Vendor ID"></asp:BoundField>    
                <asp:BoundField DataField="VENDOR_NAME" HeaderText="Vendor Name"></asp:BoundField>    
                <asp:BoundField DataField="ITEM_DESC" HeaderText="Item Desc"></asp:BoundField>    
            <asp:BoundField DataField="SYS_DATE" HeaderText="System Date"></asp:BoundField>    
        </Columns>    
        <FooterStyle CssClass="GridFooter" BackColor="#990000" Font-Bold="True" ForeColor="White" />    
        <PagerStyle CssClass="GridPager" ForeColor="#333333" BackColor="#FFCC66" HorizontalAlign="Center" />    
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />    
        <HeaderStyle CssClass="GridHeader" BackColor="#990000" Font-Bold="True" ForeColor="White"  />    
        <RowStyle CssClass="GridItem" BackColor="#FFFBD6" ForeColor="#333333" />    
    <AlternatingRowStyle  CssClass="GridAltItem" BackColor="White" />
</asp:GridView>

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET