Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
XamDataGrid - MouseLeftButtonUp
posted

Hi There,

I have a XamDataGrid binding to an observable collection of objects. I have a MouseLeftButtonUp. I want different actions based on column click by user. How can get a column name and datarecord in event handler.

================================================================

<igDP:XamDataGrid Grid.Row="0" x:Name="dataGrid"
                                    GroupByAreaLocation="None"
                                    MouseLeftButtonUp="DataGridMouseLeftButtonUp">

    <igDP:XamDataGrid.FieldSettings>
        <igDP:FieldSettings AllowCellVirtualization="True"
            AllowEdit="False"
            CellClickAction="SelectRecord"
            SummaryDisplayArea="None"
            LabelClickAction="Nothing"  />
        </igDP:XamDataGrid.FieldSettings>
  <igDP:XamDataGrid.FieldLayoutSettings>
    <igDP:FieldLayoutSettings AllowDelete="False"
      AutoGenerateFields="False"
      AutoFitMode="Always"
      SelectionTypeRecord="None"
      RecordSelectorLocation="None" />
   </igDP:XamDataGrid.FieldLayoutSettings>
    
    <igDP:XamDataGrid.FieldLayouts>
        <igDP:FieldLayout>
            <igDP:FieldLayout.Fields>        
                    <igDP:Field Name="Col1" Label="Col1"/>    
                    <igDP:Field Name="Col2" Label="Col2"/>    
                    <igDP:Field Name="Col3" Label="Col3"/>
                    <igDP:Field Name="Col4" Label="Col4"/>
                    <igDP:Field Name="Col5" Label="Col5"/>
            </igDP:FieldLayout.Fields>
        </igDP:FieldLayout>
    </igDP:XamDataGrid.FieldLayouts>

</igDP:XamDataGrid>

================================================================

private void DataGridMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
   // Want to know which column and which record or cell value was clicked


}

================================================================

Please let me know.

Thanking you in advance for help.

Nasir