Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 列数未知的C1FlexGrid_C#_Windows Runtime_Winrt Xaml_C1flexgrid - Fatal编程技术网

C# 列数未知的C1FlexGrid

C# 列数未知的C1FlexGrid,c#,windows-runtime,winrt-xaml,c1flexgrid,C#,Windows Runtime,Winrt Xaml,C1flexgrid,我目前正在调查ComponentOne的FlexGrid是否适合我的需要,但我遇到了一个无法解决的问题 我的目标是显示和更新:编辑列数未知的行中的数据。假设这是我的模型: public class writtenTests { public Student student { get; set; } public List<test> tests { get; set;} } 等等 如果我担心C1FlexGrid无法做到这一点:有人能提出其他解决方法吗?我希望避免硬

我目前正在调查ComponentOne的FlexGrid是否适合我的需要,但我遇到了一个无法解决的问题

我的目标是显示和更新:编辑列数未知的行中的数据。假设这是我的模型:

public class writtenTests
{
    public Student student { get; set; }
    public List<test> tests { get; set;}
}
等等

如果我担心C1FlexGrid无法做到这一点:有人能提出其他解决方法吗?我希望避免硬编码一个给定的隐式代码:最大测试数

非常感谢

阿德里安

编辑1:

用户3wic要求我发布xaml初始化,因此如下所示:

xaml看起来像普通atm,就像任何人初始化FlexGrid一样:

<c1:C1FlexGrid x:Name="c1FlexGrid1" Grid.Row="1" 
                       AutoGenerateColumns="False"
                       ShowOutlineBar="True"
                       SelectionMode="CellRange"
                       AllowMerging="All"
                       BorderThickness="1">
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding Path=student.Nachname}" Width="180"/>
                <c1:Column Binding="{Binding Path=student.Vorname}" Width="120"/>
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
在codebehind中,我将数据源设置为flexgrid

ObservableCollection<writtenTests> data = dbMethods.getWrittenTests(selectedCourse);

c1FlexGrid1.ItemsSource = new C1.Xaml.C1CollectionView(data);
这里的问题是我不能添加另一个绑定,比如

<c1:Column Binding="{Binding Path=tests}" />
因为同样通过设置AutoGenerateColumns=true,只生成一列,其中包含List.toString方法的结果


我认为造成这些困难的原因是C1FlexGrid设计为将一行作为一个对象,并具有给定数量的硬编码属性。

您能否提供一些代码,说明如何将集合绑定到控件以及如何在xaml中初始化控件?很难猜到你尝试了什么。谢谢@3wic的回复,我在上面添加了代码。
<c1:Column Binding="{Binding Path=tests}" />