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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:21:16+00:00 2026-06-01T04:21:16+00:00

The code below is in WPF in .net 4, which shows a grid which

  • 0

The code below is in WPF in .net 4, which shows a grid which is empty in the beginning. When I add elements, it will display the row with progress bar and ‘send’ button in the last two columns respectively. When I add one more row, one more progress bar and button appears. But if I click the button, all button uses same event handler. How can I make each progress bar and buttons in rows different?

<Window x:Class="ObservableCollection.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <DataGrid Name="DataGrid" ItemsSource="Binding DataGrids" AutoGenerateColumns="False" RowHeight="30"
                  ColumnWidth="100" ColumnHeaderHeight="50" HeadersVisibility="Column" AlternatingRowBackground="LightBlue"
                  CanUserAddRows="False" Background="Transparent" RowBackground="Transparent" BorderBrush="Gray"
                  CellStyle="{StaticResource Body_Conternt_DataGrid_Centering}"
                  IsReadOnly="True" Margin="49,66,45,62" Opacity="1" >
                  <DataGrid.Columns>
            <DataGridTextColumn Width="*" Header="UID" Binding="{Binding Uid}" />
            <DataGridTextColumn Width="*" Header="Type" Binding="{Binding Type}" />
            <DataGridTextColumn Width="*" Header="Channel Type" Binding="{Binding ChannelType}" />
            <DataGridTextColumn Width="*" Header="Certificate" Binding="{Binding Certificate}" />
            <DataGridTextColumn Width="*" Header="Life Cycle State" Binding="{Binding LifeCycle}" />
            <DataGridTextColumn Width="*" Header="Status" Binding="{Binding Status}" />
            <DataGridTextColumn Width="*" Header="Image UID" Binding="{Binding ImageUid}" />

            <DataGridTemplateColumn Width="*">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <ProgressBar Height="20" Value="{Binding Progress}"></ProgressBar>
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>

            <DataGridTemplateColumn Width="*">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <Button Name="btnSend" Click="btnSend_Click">Send</Button>
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
                </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
  • 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-01T04:21:17+00:00Added an answer on June 1, 2026 at 4:21 am

    am thinking of binding the Tag property to a unique key of whatever you’re trying to send,

    <Button Tag="{Binding ID}> 
    

    and on your send event get the tag value back..

    var button = sender as Button;
    var tag = button.Tag;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the code below in my WPF application which does exactly what
Platform: WPF, .NET 4, Visual Studio 2010 XAML code is as below: <telerik:RadTreeView x:Name=mytree
Background: I have a WPF UserControl (MainControl - not shown in code below) that
I am learning backgroundworker class in WPF. The code below is in file MainWindow.xaml.cs
The code below working for only first div. I can't display other divs when
The code below removes www., etc. from the beginning of websites that are entered
My .NET 4 application uses the WPF TreeView which I have enhanced to enable
So in the example code below, I create a UserControl UserControldChild which is a
I'm writing a WPF application which will monitor a feed. When there are new
Scenario: I have a WPF desktop application which will be distributed on different machines

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.