Hi,
I have grid in which 1 column (say A) if fixed and rest are not (B,C,....). I have implemented the paste from excel and followed the example. But I could see the indexes are different. For column A, it is 0 and for the columns (B,C...) are again starting from 0. So, the pasting is not working as expected. Can anyone suggest any solution?
Thanks
Indra
Hello Indra,
After further investigating this matter, I have prepared a small sample by following the step-by-step guide in our Implementing Paste from Excel in igGrid topic here and configuring some of the columns to be fixed.
The difference is in the custom getVisibleColumns function as it returns the visible columns after being fixed which causes the reordering when assigning the processed Excel data to the corresponding cell.
The columns with their original order are retrieved on the igGrid’s created event by using the igGrid’s _columns property.
// get visible columns var visibleColumns; $(document).on("igcontrolcreated", "#grid", function (evt, ui) { var columns = []; $(ui.owner._columns).each(function () { if (this.hidden !== true) { columns.push(this); } }); visibleColumns = columns; });
The result could be observed in the attachment below:
Additionally, attached could be found my sample for your reference along with the sample Excel file. Please test it on your side and let me know how it behaves.
Looking forward to your reply.
Sincerely, Riva Ivanova Associate Software Developer
4760.pasteFromExcel.zip
8484.sample-data.xlsx
Can you try your sample with updatedRecords? For updated Records, i am having an error.
Thank you for following up!
I have been looking into your additional question and I have modified the previously attached sample in order to update the currently existing records instead of adding new ones.
Attached could be found my sample for your reference and the result could be observed in the attachment below:
However, as I am not sure how the igGrid is configured on your side, in case you continue to experience any difficulties, it would be highly appreciated if you could further elaborate on what kind of errors are generated as well as the steps in order to reproduce the behavior. Also, it would be extremely helpful if you could provide me with a small sample that demonstrates the described behavior. This would be quite helpful in further investigating this matter and providing you with a solution as soon as possible.
Please let me know if you need any further assistance regarding this matter.
3010.igGridPasteFromExcel.zip
HI,
I tried your sample. But there is an issue. I copied the title column value and pasted in row 2 (title column). But it is copying to the Name column cell. Can you please try your and let me know. So it is not working as I expected.
Thank you for your follow-up message!
After looking into your question, what I could say is that if you have used the step-by-step guide and sample demo in our Implementing Paste from Excel in igGrid topic here as a reference for implementing this functionality, then this topic aims to demonstrate a possible approach on how to implement paste from Excel with the igGrid control.
It is fully implemented on the application level and is not explicitly intended to work for all possible scenarios, such as copying and pasting the data for a certain column from Excel. This may require additional configuration which should be handled entirely by the developer on the application level.
However, I have tested the described behavior with the previously attached sample, and, on my side, I am not able to reproduce it.
This could be observed in the attachment below:
Attached could be found a working sample with the newly added configuration from my previous message.
Additionally, in case you continue to experience this behavior, please note that this does not seem directly related to our controls and is more related to custom implementation and could be considered beyond the scope of Infragistics Support.
1563.paste-from-Excel-to-igGrid.zip