Dynamic data matrix WPF

后端 未结 4 1791
面向向阳花
面向向阳花 2021-01-16 09:57

I want to create a completely dynamic data matrix. For eg,

       Column1 Column2 Column3....
id1      id11    id12     id13...
id2      id21    id22     id2         


        
4条回答
  •  梦毁少年i
    2021-01-16 10:08

    You could probably use my answer to this Question. It's a subclassed DataGrid used to display, edit and databind 1D or 2D arrays and lists of dynamic size. It can be downloaded from here.

    Say you have this 2D array of strings as a Property

    public string[][] String2DArray { get; set; }
    

    then you can bind it to the DataGrid2D by adding a reference to the DataGrid2DLibrary.dll and add the namespace

    xmlns:dg2d="clr-namespace:DataGrid2DLibrary;assembly=DataGrid2DLibrary"
    
    
    

    And the Output will look like this

    alt text

提交回复
热议问题