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

  • Home
  • SEARCH
  • 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 8653973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:40:17+00:00 2026-06-12T14:40:17+00:00

i have a datagrid that load the data from my database. in my datagrid,

  • 0

i have a datagrid that load the data from my database. in my datagrid, i also included the , so that i can checked or unchecked the row.

here is the picture.
enter image description here

here is my xaml.

<DataGrid AutoGenerateColumns="False" Height="258" HorizontalAlignment="Left" Margin="12,0,0,12" 
              Name="dataGrid1" VerticalAlignment="Bottom" Width="479" ItemsSource="{Binding data}" 
              AlternatingRowBackground="#FFC4B0B0">
        <DataGrid.Columns>
            <DataGridTextColumn Binding="{Binding nCateogryID}" Header="No." IsReadOnly="True" Width="30" />
            <DataGridTextColumn Binding="{Binding sCategoryDesc}" Header="Nama Kategori" IsReadOnly="True" Width="160" />
            <DataGridTextColumn Binding="{Binding sCategoryItems}" Header="Keterangan Kategori" IsReadOnly="True" Width="170" />
            <DataGridCheckBoxColumn Header="Checked?" />
        </DataGrid.Columns>
    </DataGrid>

May question is:
How can i know which data already checked whenever i hit the ‘Button’? I also do search on google, but found nothing.

i think like this. whenever i click ‘Button’, i will start to check for each row. how can i do it? any sample for that?

i also think to find another solution, how about using the event handler? thats mean whenever i click for the row and checked, i will trigger the event and check if is it checked or not. How can i do it?

For me, using the event handler is more achieveable because it’s much faster rather i have to checked, and press button. lets say if i have only 10 rows, that’s not a big problem. How about if i have 1000rows? if i check one by one, it will be troublesome. waste alot of time. any idea? thanks.

Or maybe use the datagrid_selectionchanged.
How can i check the checkbox has been checked or not?

because if we wait until user press button, then we check is checked or not, i think its a slow process. you have to check for each row. if my row only 10rows, maybe its okay. how about if i have 1000 rows need to check? thanks. 🙂

  • 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-12T14:40:18+00:00Added an answer on June 12, 2026 at 2:40 pm
    for(int i=0;i<DataGrid.items.count-1;i++)
    {
         CheckBox chkBx = (CheckBox)DataGrid.items[i].Cells[3].FindControl("EmpId") ;
         if( chkBx !=null && chkBx.Checked )
          {
            Response.Write(DataGrid.items[i].Cells[1].Text.ToString() );
          }
    }
    

    Here “EmpId” is checkbox name(control name) and i am using value of first cells for write. You can change the cell index as you want to use.

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

Sidebar

Related Questions

I have a datagrid that I have filled with data from a sql database.
I have a WPF DataGrid that I load with data from a SQL db.
I have a WPF DataGrid that will be populated from a data table having
I have a datagrid view which shows table data from a database Environment: -
I have a DataGrid that represents layers - each row is an image on
I have a datagrid that is filled with a dataset from an SQL query.
I have a DataGrid that is showing some data via a PagedCollectionView with one
I have a WPF DataGrid that increases in height when I add data to
I have a DataGrid component that displays a few columns of data. It has
Hey guys, I have an application that I want to display some data from

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.