TreeNode tnKey =
treeViewFilters
.Nodes
.Cast<TreeNode>()
.Where(r => r.Text == FilterName)
.ToArray()[0];
上記のコードは機能しません。エラーを報告します
Error 1 Instance argument: cannot convert from 'System.Windows.Forms.TreeNodeCollection' to 'System.Data.EnumerableRowCollection'
Error 2 'System.Windows.Forms.TreeNodeCollection' does not contain a definition for 'Cast' and the best extension method overload 'System.Data.EnumerableRowCollectionExtensions.Cast<TResult>(System.Data.EnumerableRowCollection)' has some invalid arguments
TreeView.Nodes コレクションで TreeNode.Text フィールドを検索する方法はありますか?からコードを取得しました。何か案は?