Hi,
I would like to add a new row in between extisting records using a context menu. Please provide some samples.
Thanks,
Ayyappan
Hello Mario,
I have been looking into your code and I can say that the XamDataGrid’s DataItems collection can be used if you want to add Items directly in the XamDataGrid and its DataSource shouldn’t been set to any object. In my sample I add the new Record in the underlying Data object and since the XamDataGrid is bound to it, changes reflects on the UI. Here you can read more about XamDataGrid’s DataItem Property:
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataPresenterBase~DataItems.html
Hope this helps you.
use the version 11.2 and all developed in WPF I'll send you an example using entity framework here is an example of code Thanks for your help
ScadeXamDataGrid.DataSource = RetQuerryWPFSCANew()
Dim reca As Infragistics.Windows.DataPresenter.DataRecord = ScadeXamDataGrid.ActiveRecord Dim rins As Infragistics.Windows.DataPresenter.DataRecord = ScadeXamDataGrid.RecordManager.CurrentAddRecord
rins.Cells("codice").Value = reca.Cells("codice").Value rins.Cells("numdoc").Value = reca.Cells("numdoc").Value rins.Cells("datadoc").Value = reca.Cells("datadoc").Value rins.Cells("totdoc").Value = reca.Cells("totdoc").Value
ScadeXamDataGrid.DataItems.Insert(2, rins) ScadeXamDataGrid.RecordManager.CommitAddRecord()
Could you please tell me ,which is the exact version you are using and send me steps to reproduce, because I checked my sample again and it seems like everything works ok on my side.
Looking forward for your reply.
I tried this example but it gives me this errorThe index must be within the limits of the list.Parameter name: index
Hello Ayyappan,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.