ArrayList を使用して、BindingList にバインドしようとしています...
入れようとすると(Option Strict Onがあります)、実装したキャストの提案が表示されます-
それでも、何を試しても実行時エラーが発生し続けます。
Unable to cast object of type 'ArrayList' to type 'IList`
コード:
Dim myBoundList As System.ComponentModel.BindingList(Of something) =
New System.ComponentModel.BindingList(Of something)
(CType(myArrayList, System.Collections.Generic.IList(Of something)))
.ToArray を挿入しようとしました...
リンクhttps://stackoverflow.com/a/8770832/1217150で受け入れられた回答は、まったく同じことを行い(意図は反対ですが)、試してみました...(つまり、IListアイテムを作成します、および割り当て
IList iList = new ArrayList();
それは私に同じエラーを与えます...
私は VB.NET を使用していますが、c# も役立ちます。助けてください。ありがとうございました。