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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:01:53+00:00 2026-05-24T07:01:53+00:00

Repeats every MessageBox.Show(this.myProduct.Radif.ToString()); !!!! What’s happening? xaml code : <dg:DataGrid.Columns> <dg:DataGridTextColumn Binding={Binding IdBook} Header=IdBook

  • 0

Repeats every MessageBox.Show(this.myProduct.Radif.ToString());!!!!

What’s happening?

xaml code :

 <dg:DataGrid.Columns>
            <dg:DataGridTextColumn Binding="{Binding IdBook}" Header="IdBook" ></dg:DataGridTextColumn>
            <dg:DataGridTextColumn Binding="{Binding NameBook}" Header="NameBook"></dg:DataGridTextColumn>
            <dg:DataGridTextColumn Binding="{Binding Author}" Header="Author"></dg:DataGridTextColumn>
            <dg:DataGridTextColumn Binding="{Binding Price}" Header="Price"></dg:DataGridTextColumn>
            <dg:DataGridTextColumn Binding="{Binding DateRegister}" Header="DateRegister"></dg:DataGridTextColumn>
            <dg:DataGridTextColumn Binding="{Binding Description}" Header=Description" Width="*"></dg:DataGridTextColumn>
            <dg:DataGridTemplateColumn>
                <dg:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <CheckBox IsChecked="{Binding Selecting, UpdateSourceTrigger=PropertyChanged}" Checked="Checked" Unchecked="UnChecked" />
                    </DataTemplate>
                </dg:DataGridTemplateColumn.CellTemplate>
            </dg:DataGridTemplateColumn>

my code :

    private List<Book> MyProd = new List<Book>();
    private Book myProduct = null;

    private void Checked(object sender, RoutedEventArgs e)
    {
        this.myProduct = new Book();
        this.myProduct = (Book)dataGrid.CurrentItem;
        MessageBox.Show(this.myProduct.No.ToString());
    }

class Book
{
    public int No{ get; set; }
    public string NameBook { get; set; }
    public string Author { get; set; }
    public string Description { get; set; }
    public string DateRegister { get; set; }
    public Int64 Price { get; set; }
    public bool Selecting { get; set; }
}
  • 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-24T07:01:54+00:00Added an answer on May 24, 2026 at 7:01 am

    Checkbox’s Checked / Unchecked events are actually primitive ToggleButton.Checked / Unchecked types and their usage is not encouraged by the developer community.

    Instead you can handle CheckBox.Click event and inside that handler ….

     if (((CheckBox)sender).IsChecked.GetValueOrDefault(false))
     {
           //// Your Checked Code Here ...
     }
     else
     {
          //// Your unchecked code here ...
     }
    

    These should avoid the repeated execution of the checked code…

    In fact instead of having multiple checkboxes handling to the same click event handler you can use the bubbling of attached routed event called Button.Click.

    1. Handle Button.Click at your DataGrid level.

      <dg:DataGrid Button.Click="CheckBoxClick" ... >
              ....
      
    2. Name your checkbox in the template column.

      <CheckBox IsChecked="{Binding Selecting, UpdateSourceTrigger=PropertyChanged}" x:Name="LocalColumnCheckbox" />
      
    3. In the CheckBoxClick handler use this code …

      private void CheckBoxClick(object sender, RoutedEventArgs e)
      {
              var checkBox = e.OriginalSource as CheckBox;
              if (checkBox != null && checkBox.Name == "LocalColumnCheckbox")
              {
                      if (checkBox.IsChecked.GetValueOrDefault(false))
                      {
                                 //// Your Checked Code Here ...
                      }
                      else
                      {
                                //// Your unchecked code here ...
                      }
              }
      }
      

    let me know if this helps.

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

Sidebar

Related Questions

I have this code to change the number in the NSString every five seconds.
hello every one i am using this code to give glowing effect to my
I have a timer that loops through following code every second. this code reads
This question repeats my earlier one but my earlier one was a failure because
Any suggestions on how I can cleanup the following code pattern that repeats multiple
Primarily I'm looking for a way to create an nstimer scheduledTimerWithTimeInterval that repeats every
I'm currently using a loop that repeats itself every few milliseconds in my program.
I have looked at every instance of this question on Stack as well as
I have setup two timers in my application which both repeats every a few
I expect that code to display New Version at every 3 seconds but it

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.