Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to tell what column or cell is being edited
Message
De
25/02/2013 10:07:01
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
How to tell what column or cell is being edited
Divers
Thread ID:
01566855
Message ID:
01566855
Vues:
49
Hi,

I have a datagrid defined like this:
                        <DataGrid AutoGenerateColumns="False" Grid.Row="4" Grid.Column="1" 
                                  Height="Auto" 
                                  HorizontalAlignment="Stretch" 
                                  Margin="0" 
                                  Name="grdCashReceipts" 
                                  VerticalAlignment="Stretch" 
                                  Width="Auto" 
                                  IsSynchronizedWithCurrentItem="True" 
                                  ItemsSource="{Binding Mode=default}" 
                                  SelectionMode="Single" 
                                  GridLinesVisibility="None" 
                                  HeadersVisibility="Column" 
                                  Grid.ColumnSpan="2" 
                                  CellEditEnding="grdCashReceipts_CellEditEnding" 
                                  CanUserAddRows="False" 
                                  CanUserDeleteRows="False" 
                                  SelectionUnit="Cell" 
                                  Grid.RowSpan="2" 
                                  AlternatingRowBackground="LightGray">
                            <DataGrid.Resources>
                                <Style x:Key="AlignRight" TargetType="DataGridCell">
                                    <Setter Property="HorizontalAlignment" Value="Right" />
                                </Style>
                                <Style x:Key="AlignRightHeader" TargetType="DataGridColumnHeader">
                                    <Setter Property="HorizontalAlignment" Value="Right" />
                                </Style>
                            </DataGrid.Resources>
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Invoice #"
                                                    Width="*" 
                                                    Binding="{Binding crt_invfk, Converter={StaticResource Inv_PkToNumberConverter}}"                                                     
                                                    x:Name="txtInv_Number" IsReadOnly="False"/>

                                <DataGridTextColumn Header="Invoice Date" 
                                                    Width="*" 
                                                    Binding="{Binding crt_invfk, Converter={StaticResource Inv_PkToInvoicePropertyConverter}, 
                                                              ConverterParameter='inv_date', Mode=OneWay, StringFormat=d}"
                                                    IsReadOnly="True"/>
                                
                                <DataGridTextColumn Header="Amount" 
                                                    Width="*" 
                                                    Binding="{Binding crt_Amount, Mode=default}"
                                                    CellStyle="{StaticResource AlignRight}"
                                                    HeaderStyle="{StaticResource AlignRightHeader}"/>
                                
                            </DataGrid.Columns>
                        </DataGrid>
In the following method, I need to determine if I am editing the Invoice # column or txtInv_Number textbox:
private void grdCashReceipts_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
How can I do that check?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform