Hi,
I am new to xamDataGrid and I have question on how to archieve paste multiple rows when I select the last row in the data grid.
I always get a message "The area taht you are trying to paste the clipboard infomration does not have enough rows. Continue will copy as much in information as can fit in the cells available but will result in loss of data. Continue with operation?"
If I press ok, only the first row will be pasted.
What I want is that all other rows can be created as new, is this possible?
Thank you!
Hi Ima,
In order to paste the selected record (s) you need to select the add new row and then press paste. To enable the add new row set: XDP.FieldLayoutSettings.AllowAddNew to true.
If for some reason you don’t wish to show the Add new row all the time you can hook to the copy command and enable the add new only then and after paste was execute to hide it.
Thanks,
Slavi
Thanks for the quick reply.
Here is my code snippets:
<ig:XamDataGrid x:Name="igGrid" Grid.Row="2" Height="400" > <!-- Disable XamDataGrid fields automatic generation. --> <ig:XamDataGrid.FieldLayoutSettings> <!-- If you prefer to design your own fields' layout, set AutoGenerateFields property to 'False' and create Fields collection --> <ig:FieldLayoutSettings AutoGenerateFields="False" SelectionTypeCell="Default" SelectionTypeField="Single" SelectionTypeRecord="Extended" AllowAddNew="True" AddNewRecordLocation="OnBottomFixed" AllowClipboardOperations="All" CopyFieldLabelsToClipboard="True"/> </ig:XamDataGrid.FieldLayoutSettings> <ig:XamDataGrid.FieldLayouts > <ig:FieldLayout IsDefault="True" > <ig:Field Name="SKU"/> <ig:Field Name="Name" /> <ig:Field Name="Category" /> <ig:Field Name="Supplier" /> </ig:FieldLayout> </ig:XamDataGrid.FieldLayouts> <!-- Enable field selection and disable cell editing--> <ig:XamDataGrid.FieldSettings> <ig:FieldSettings LabelClickAction="SelectField" AllowEdit="True"/> </ig:XamDataGrid.FieldSettings> </ig:XamDataGrid>
The put the "new row" at the bottom.
Only when I select the "new row", paste multiple rows works.
However if I select last row (not the "new row"), the messagebox will still display