-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'OpenXmlElementList' does not contain a definition for 'GetItem' #1651
Comments
Can you share your code sample? Did you try: OpenXmlElementList list = ....;
var item = list[index]; There were a number of breaking changes from v2.x - not sure if this one got documented, but let me know if it works and I'll make sure the docs are updated. |
Tried, seems to work. I was just not finding any breaking change in the docs regarding that method. |
@twsouthwick what exactly is needed here? Code change or documentation? |
Docs update |
How to do that?? |
Where to write this?? |
https://github.com/OfficeDev/open-xml-docs/blob/main/docs/migration/migrate-v2-to-v3.md Happy to take a PR to update that or any other doc changes :) |
Can u please explain in detail what exactly nedds to be done to use getitem(). |
OpenXmlElementList list = ....;
var item = list.GetItem(index); to OpenXmlElementList list = ....;
var item = list[index]; |
Hi twsouthwick, |
What I supplied is the only step needed. The call to GetItem needs to be changed to an indexer. |
doc.WorkbookPart.SharedStringTablePart.SharedStringTable.ChildElements.GetItem(int.Parse(value)).InnerText How will you rewrite this? |
doc.WorkbookPart.SharedStringTablePart.SharedStringTable.ChildElements.GetItem(int.Parse(value)).InnerText Help me rewrite this. U can see getitem here |
doc.WorkbookPart.SharedStringTablePart.SharedStringTable.ChildElements[int.Parse(value)].InnerText |
Thanks @BazInTheAZ :) @Babufrik123 I'd recommend taking a look at some of C# specifications so you can understand the syntax here: https://learn.microsoft.com/dotnet/csharp/programming-guide/indexers |
Missing method for getting item from OpenXmlElementList class.
Starting from version: 3.0.0
Working version: 2.20.0
Error CS1061 'OpenXmlElementList' does not contain a definition for 'GetItem' and no accessible extension method 'GetItem' accepting a first argument of type 'OpenXmlElementList' could be found (are you missing a using directive or an assembly reference?)
The text was updated successfully, but these errors were encountered: