Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Bind to Image Tag inside Xceed Datagrid?

$
0
0

I want to bind 'Id' field to tag of image which inside column of xceed datagrid.

    <xcdg:Column FieldName="D" Title="Delete" Width="50" CellHorizontalContentAlignment="Center" CellVerticalContentAlignment="Center">
                    <xcdg:Column.CellContentTemplate>
                        <DataTemplate>
                            <Image Source="{StaticResource imgDelete}" Tag="{Binding Id}" Width="16" Height="16" Cursor="Hand"
                                   x:Name="imgEdit" MouseLeftButtonUp="imgDelete_MouseLeftButtonUp" ToolTipService.ToolTip="Edit" />
                        </DataTemplate>
                    </xcdg:Column.CellContentTemplate>
                </xcdg:Column>

But in event handler I am getting Tag as null.

    private void imgDelete_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
            {
                                                    AreaId = Convert.ToInt32((sender as Image).Tag);
                                                   catch (Exception en)
                        }


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>