Hi Thomas,
You can bind the entire Record of the particular row to the DataTemplate objects by binding Record.Data. You can also access the corresponding Column value by its MappingName as in the following code snippet.
Code Snippet:
<syncfusion:GridDataVisibleColumn HeaderText="ProductID" MappingName="ProductID"> <syncfusion:GridDataVisibleColumn.CellItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Record.Data.CustomerID}" Width="75"/> <TextBlock Text="{Binding Record.Data.CustomerName}" Width="75"/> </StackPanel> </DataTemplate> </syncfusion:GridDataVisibleColumn.CellItemTemplate> </syncfusion:GridDataVisibleColumn>
|
Please let us know if you have any concerns.
Regards,
Divya.
Hi Thomas,
Thank you for your patience.
If you want to display the CellBoundValue to the template column, you can display it by using the CellBoundValue , Please refer the following code snippet,
<syncfusion:GridDataVisibleColumn HeaderText="ProductID" MappingName="ProductID"> <syncfusion:GridDataVisibleColumn.CellItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=CellBoundValue}" Width="75"/> </StackPanel> </DataTemplate> </syncfusion:GridDataVisibleColumn.CellItemTemplate> </syncfusion:GridDataVisibleColumn> |
And also If you want to display the corresponding column value to the template column, you can use the Record.Data.MappingName. Please refer the following code snippet,
<syncfusion:GridDataVisibleColumn HeaderText="ProductID" MappingName="ProductID"> <syncfusion:GridDataVisibleColumn.CellItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Record.Data.ProductID}" Width="75"/> </StackPanel> </DataTemplate> </syncfusion:GridDataVisibleColumn.CellItemTemplate> </syncfusion:GridDataVisibleColumn> |
If you want to display the other property value in column, you can bind as Record.Data.PropertyName. Please refer the following code snippet,
<syncfusion:GridDataVisibleColumn HeaderText="ProductID" MappingName="ProductID"> <syncfusion:GridDataVisibleColumn.CellItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Record.Data.CustomerID}" Width="75"/> <TextBlock Text="{Binding Record.Data.CustomerName}" Width="75"/> </StackPanel> </DataTemplate> </syncfusion:GridDataVisibleColumn.CellItemTemplate> </syncfusion:GridDataVisibleColumn> |
Please let us know if you have any queries,
Regards,
Ganesan V