Hi,
We have added Button in XAMData Grid, and we want to get current row data as we click on Button. We have added button like that way in XAMdata Grid.
<igDP:XamDataGrid Name="grdSelectedMenu" DataSource="{Binding SelectedModuleList}" MaxHeight="500"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" /> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="IsChecked" Label="Select" Visibility="Visible" Width="auto" /> <igDP:UnboundField Name="Setup" Width="130"> <igDP:UnboundField.Settings> <igDP:FieldSettings> <igDP:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Button Content="Config Properties" Width="100" FontSize="11" Height="25" x:Name="btnConfigProperties" Click="btnConfigProperties_Click_1"></Button> </ControlTemplate> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.CellValuePresenterStyle> </igDP:FieldSettings> </igDP:UnboundField.Settings> </igDP:UnboundField> <igDP:Field Name="FileName" Label="File Name" Width="auto" /> <igDP:Field Name="FilePath" Label="File Path" Width="auto" /> </igDP:FieldLayout.Fields> <igDP:FieldLayout.SortedFields> <igDP:FieldSortDescription FieldName="FileId"></igDP:FieldSortDescription> </igDP:FieldLayout.SortedFields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
We want as we click on Button the current File Name and Current File Path, we can fetch. Please let us suggest for that.
Thanks
Hello kanwar,
I am just checking if you have any further questions on this matter. Please do not hesitate to let me know if you do.
Thank you for your post!
I have been looking into it and what I can suggest is on the click event of the button to get the TemplatedParent of the Button. In this case the TemplatedParent is the CellValuePresenter.
Using the CellValuePresenter you can get the DataItem, which is the row data.
I have created a small sample application for you with the above mentioned functionality. Please find the attachment and feel free to let me know if you have any further questions on this matter.