Link to home
Start Free TrialLog in
Avatar of Jeff Fillegar
Jeff FillegarFlag for United States of America

asked on

asp.net gridview with checkbox

Hello experts,

I have a gridview with a checkbox column.  I am binding the gridview to a dataset. The first column in the dataset is bool (true\false).  When the page loads, how can I programmatically check the check boxes if the dataset column == true?

Thanks in advance.

            <asp:GridView ID="gvPayments" runat="server" AutoGenerateColumns="false"
                DataKeyNames="rowid" GridLines="None" AllowPaging="false" CssClass="gvGrid"
                PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
                >
            <Columns>    
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox ID="ChkAll" runat="server" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSel" class="chkSel" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="path" HeaderText="path"
                    SortExpression="path" />
                <asp:BoundField DataField="valuetext" HeaderText="value"
                    SortExpression="valuetext" />
            </Columns>
            </asp:GridView>
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial