Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7875805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:03:43+00:00 2026-06-03T03:03:43+00:00

i have made a gridview which has many columns and the editmode , some

  • 0

i have made a gridview which has many columns and the editmode , some are text and dropdown list are are working perfect .

How can i assign value to a Checkbox to make it Checked or Unchecked?

The value against which i want to do is Yes / No.

So i am having trouble doing this.

My Gridview: Just pasting portion of it as its too big.

<asp:TemplateField HeaderText="CUpdate">
    <ItemTemplate >
         <asp:Label ID="Label6" runat="server" Text='<%# Eval("CUpdate") %>' ></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
         <asp:TextBox runat="server" ID="txtCupdate" Text='<%# Eval("CUpdate") %>' ></asp:TextBox>
    </EditItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="Email">
    <ItemTemplate >
        <asp:Label ID="Label6" runat="server" Text='<%# Eval("Email") %>' ></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:CheckBoxList ID="checkEmail"  runat="server">
            <%--HOW TO MAKE THIS CHECKED OR UNCHECKED ? when i have values Yes / NO--%>

        </asp:CheckBoxList>
     </EditItemTemplate>
</asp:TemplateField>

Update

If i make the above as :

 <EditItemTemplate>
        <asp:CheckBoxList ID="checkEmail" selectedvalue='<%# Eval("Email") %>'  runat="server">
            <asp:ListItem Value="Yes">Yes</asp:ListItem>

        </asp:CheckBoxList>
     </EditItemTemplate>

In this case i do get checkbox checked when there us Yes , but in case on NO it wont run possible error as there is no value ‘NO’ to select in the checboxlist .Any solution.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:03:44+00:00Added an answer on June 3, 2026 at 3:03 am

    Your CheckBoxList needs to have all the posible values like so..

    <asp:CheckBoxList ID="checkEmail" selectedvalue='<%# Eval("Email") %>'  runat="server">
        <asp:ListItem Value="Yes">Yes</asp:ListItem>
        <asp:ListItem Value="No">No</asp:ListItem>
    </asp:CheckBoxList>
    

    Although i don’t understand why you want to use a CheckBoxList instead of just 1 checkbox like so..

    <asp:CheckBox runat="server" ID="checkEmail" Checked = '<%# Eval("Email").ToString().Equals("yes", StringComparison.OrdinalIgnoreCase) %>' />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView (GridView) with multiple columns and so far I can sort
What I tried Hello Guys, I have made a GridView which I've filled over
I have a very simple SQL query that I made which retrieves some user
I have made a multiplayer game using the GameKit Framework where 2 iPhones/iPods can
I have made a game which is nearly identical to Popcap's Atomica. ( http://www.popcap.com/gamepopup.php?theGame=atomica
I have made a generic Observer interface and an Observable class, but can't compile
I have made a basic ascx control which is just a panel with a
Basically in my in my aspx page I have a gridview which displays the
I have a GridView with 4 images per row, and normally has more than
I have a user control which has a number of properties. This user control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.