0

I have already added a checkbox column in grid and later on dynamically adding other columns and data.
I can see that column is appearing in grid with other columns but am not able to check/uncheck any individual row.

Anybody can tell me whats I am missing? For more reference here is the code.

<asp:GridView ID="gdv_items" runat="server" EnableModelValidation="True" >
        <Columns>
            <asp:CheckBoxField HeaderText="Select" />
        </Columns>
</asp:GridView>            

            gdv_items.DataSource = dt_items;// Datatable already loaded from DB.

            gdv_items.DataBind();
3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by dnanetwork
0

I think you need to add an a checkbox within an itemtemplate in a gridview..something like:

<asp:TemplateField HeaderText="Login"><ItemTemplate><asp:Button ID="btnLogin" runat="server" Text="Login" CommandArgument='<%# Eval("MemberId", "{0}")%>' CommandName="Login" ToolTip="Click here to Login" CssClass="btnbgtrans"/></ItemTemplate><HeaderStyle Width="5%" ForeColor="Black" CssClass="titleCommission paddingleft5" HorizontalAlign="center"/><ItemStyle HorizontalAlign="center" CssClass="paddingleft5"/></asp:TemplateField>

I've placed a command button in my grid, however the concept is just the same.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.