Get all checked nodes of a treeview

Write your extension method in a SEPARATE static class (not nested). Add another file to your project, and create a static class there, with your static extension method inside.

The error in your question (and the one you got from trying to add it to a nested class) should be self-explanatory

Leave a Comment