CustomCopyPaste trigger property changed
Hi,
I followed your example on custom pasting: How to add the copied rows as new rows in the SfDataGrid while pasting? | WPF - SfDataGrid (syncfusion.com)
In my case, I needed a bit more custom pasting.
The grids first column is a combobox column, that updates the second column on selected item, so on paste, the PasteCell updates the first column, then skips the second column and on to the third cell and etc.
XAML:
<syncfusion:SfDataGrid AllowFiltering="True"
AddNewRowPosition="FixedTop"
AutoGenerateColumns="False"
EditTrigger="OnTap"
ColumnSizer="Star"
ItemsSource="{Binding Data}"
Margin="0,0,0,40" >
<syncfusion:SfDataGrid.Columns>
<syncfusion:GridComboBoxColumn IsEditable="True" AllowEditing="True" MappingName="Material" HeaderText="Material" ItemsSource="{Binding Materials}"/>
<syncfusion:GridTextColumn IsReadOnly="True" MappingName="MaterialDesc" HeaderText="Material Desciption"/>
<syncfusion:GridNumericColumn AllowEditing="True" MappingName="Blocked" HeaderText="Blocked" NumberDecimalDigits="0"/>
</syncfusion:SfDataGrid>
The paste work, it pastes into the 1st and 3rd column as intended.
My question is, how to update the 2nd column after/under paste?
Regards,
Attila
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
VS
Vijayarasan Sivanandham
Syncfusion Team
March 29, 2021 04:39 PM UTC
Hi Attila Toroczkai,
Thank you for contacting Syncfusion Support.
Based on provided information we have prepared the simple sample to replicate your scenario. Copy pastes properly working in SfDataGrid. Please refer the below mentioned link for sample,
Sample Link: https://www.syncfusion.com/downloads/support/forum/163916/ze/Sample-532787150
Based on provided information we have prepared the simple sample to replicate your scenario. Copy pastes properly working in SfDataGrid. Please refer the below mentioned link for sample,
Sample Link: https://www.syncfusion.com/downloads/support/forum/163916/ze/Sample-532787150
We are little unclear with your previous update mentioned as “The grids first column is a combobox column, that updates the second column on selected item”. Can you please provide the more information related to your query?
Can you please share us below things?
1. Provide more details and code snippet related to set the value based on SelecteItem in SfDataGrid?
2. Provide the property type of “MaterialDesc” mapping name?
3. Provide the XAML and cs file related to SfDataGrid
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
Can you please share us below things?
1. Provide more details and code snippet related to set the value based on SelecteItem in SfDataGrid?
2. Provide the property type of “MaterialDesc” mapping name?
3. Provide the XAML and cs file related to SfDataGrid
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
AT
Attila Toroczkai
March 30, 2021 05:01 AM UTC
Hi Vijayarasan S,
Attachment: Sample1_57c7aa4f.zip
I modified the sample, to my scenario.
Modified the Model.cs and the paste method.
Hopefully the code can better describe it.
Regards,
Attila
Attachment: Sample1_57c7aa4f.zip
VS
Vijayarasan Sivanandham
Syncfusion Team
March 31, 2021 06:02 PM UTC
Hi Attila Toroczkai,
Thanks for the update.
We have checked the provided sample second column value updated properly while pasting new column in SfDataGrid. Please find the tested sample and video demo from our end in the below link,
Sample Link: https://www.syncfusion.com/downloads/support/forum/163916/ze/Sample1-209369102
Sample Link: https://www.syncfusion.com/downloads/support/forum/163916/ze/Sample1-209369102
Video Link: https://www.syncfusion.com/downloads/support/forum/163916/ze/ValueUpdateProperly402991472
Can you please share us below things?
1. Provide the video illustration of the reported issue
2. Provide more details about your scenario with image illustrations?
1. Provide the video illustration of the reported issue
2. Provide more details about your scenario with image illustrations?
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
Marked as answer
AT
Attila Toroczkai
April 1, 2021 04:38 AM UTC
Hi Vijayarasan S,
Thank you for the update.
I made a mistake and now I have fixed it ... (I was updating the desc column before the property setting was finished.)
Thank you for your help and time.
Regards,
Attila
VS
Vijayarasan Sivanandham
Syncfusion Team
April 1, 2021 07:08 AM UTC
Hi Attila Toroczkai,
Thanks for the update.
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Vijayarasan S
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
- Marked answer
-
AT Attila Toroczkai
- Mar 26, 2021 12:48 PM UTC
- Apr 1, 2021 07:08 AM UTC