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 6937977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:25:57+00:00 2026-05-27T12:25:57+00:00

I have a repeater and inside it i have a checkbox. Now i want

  • 0

I have a repeater and inside it i have a checkbox. Now i want to check it according to columns value(0/1). I have tried it through the itemDataBound event of the repeater. what its doing if the rows has value 1 then its checked all checkbox and if first checkbox is unchecked then its unchecked all.
my code is:-
`

                    <td align="center">
                        <asp:CheckBox ID="chk" runat="server" />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>`

The ItemDataBound events code is :-

 protected void rp_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    DataTable dt = new DataTable();
    dt = obj.abc(id);
    if (dt.Rows.Count > 0)
    {
        CheckBox chk = (CheckBox)(e.Item.FindControl("chk"));
        if (chk != null)
        {

            if (Convert.ToInt32(dt.Rows[0]["xyz"]) == Convert.ToInt32("0"))
            {
                chk.Checked = false;
            }
            else
            {
                chk.Checked = true;

            }
        }

    }

}
  • 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-05-27T12:25:57+00:00Added an answer on May 27, 2026 at 12:25 pm

    There are many ways to do that.

    1. You can write inline ASP.NET:

      <asp:CheckBox id='isMarried' runat='server' 
      Checked='<%# Convert.ToBool(Eval("IsMarried")) ? true : false %>' />
      
    2. As you have mentioned, you can use repeater_ItemDataBound to find the check-box of each row, and set its value accordingly:

      protected void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
      {
          Person person = (Person)e.Item; // e.Item is the datasoruce of the row
          if (person.IsMarried) 
          {
              CheckBox isMarried = (CheckBox)(e.Item.FindControl("isMarried"));
              isMarried.Checked = true;
          }
      }
      
    3. Another way could be to inject the Boolean state (here, the marriage state) in a hidden field and send it to the client, then on client-side, using jQuery (or any other JavaScript framework), update check-boxes’ checked state according to the value of those hidden fields:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one control named thumbviewer inside repeater. I want to set its imageurl
I have a Repeater and inside it a GridView . Now I want to
I have a Repeater nested inside of a GridView . On the RowDataBound event
I have inside repeater when i tried to find above placeholder in code behind
I have a user control inside a repeater and a custom event is raised
I have a blank Repeater nested inside a column in a GridView and want
I have a Linkbutton inside a repeater and I want to delete the Item
I have a repeater that it has image inside itself. I want to show
I have a repeater inside which i put a Checkbox and above rapeater there
I have a repeater with a checkbox inside of it. <tr class=datarow> <td style=display:

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.