我在VB中有以下内容:
Dim sources = From source In importSources Select New With _
{.Type = source.Key, .Source = source.Value.Name}
dgridSourceFiles.DataSource = sources
Run Code Online (Sandbox Code Playgroud)
当我调试时,sources显示一个内存中的查询,并在其中有2条记录.然而,datagrid视图不会显示记录.
那么为什么这不起作用呢?建议可以是VB或C#......
我用的时候:
Dim sources = (From source In importSources Select New With _
{.Type = source.Key, .Source = source.Value.Name}).ToList()
Run Code Online (Sandbox Code Playgroud)
...显示数据源.