Actually, out of 30 odd cells, I am able to get the values of 2-3 cells only. Don't how to get the cell values ? I am trying to iterate all the records and writing the same to an excel. Please help.
Hello,
I am just checking your progress on the issue that you are having.
If you require any further assistance please do not hesitate to ask.
Hello Rajib,
Thank you for your post.
I have been looking into your issue and the code snipped that you have provided. I created a short application based on your scenario and I could not manage to reproduce the issue. Would you please let me know if you get the same behavior with my sample application. If the issue is not reproducible with the sample application, would you please modify it with the functionality you are using in order to be able to further investigate your issue.
Please let me know if you need any further assistance on this matter.
Providing the BindingPath explicitly did the trick for me. Did not understand though when TradeTypeStyle have the
required binding information, it was not able to export the data to excel.
<DP:UnboundField Label="Trade Type" Name="TradeType" BindingPath="SelectedTradeType" Row="0" Column="17" Width="100">
<DP:UnboundField.Settings >
<DP:FieldSettings AllowEdit="True" CellValuePresenterStyle="{StaticResource TradeTypeStyle}" AllowFixing="No"/>
</DP:UnboundField.Settings>
</DP:UnboundField>
<Style x:Key="TradeTypeStyle" TargetType="{x:Type DP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DP:CellValuePresenter}">
<ComboBox ItemsSource="{Binding DataItem.TradeTypes}"
SelectedItem="{Binding Record.DataItem.SelectedTradeType,
RelativeSource={RelativeSource AncestorType=DP:CellValuePresenter},
Mode=TwoWay, ValidatesOnDataErrors=True}"
Style="{StaticResource DPComboBoxStyle}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I have been looking into your requirements and I am not completely sure that understand you correctly.
Would you please provide me with sample application where I can see what kind of templates you have used or provide me more information about it.
If you wish to export the information from XamDataGrid to excel file I can suggest you to use our DataPresenterExcelExporter class. You can read more details for it from the following link in our online documentation :
http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=xamDataPresenter_Export_a_DataPresenter_Control_to_Excel.html
The DataPresenterExcelExporter provides you with some events, one is CellExporting event, it occurs before a cell is exported to Excel. You can use this event in order to get the value of the cell, the record and for others functionalities. From the following link you can read more details for it:
http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.ExcelExporter.v14.1~Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter~CellExporting_EV.html
Looking forward to hearing from you.