标签云

微信群

扫码加入我们

WeChat QR Code

I have an Datagrid which needs to get filled dynamicly.The tablelayout is like: id | image | name | Description | Name-1 | Name-NThe first 4 columns are static the others are dynamic. The User should be able to add as many users as he wants. I try to compare data of multiple users by putting them next to each other in the table.Right now I have an Listbox whitch containes the Names of the dynamic generated Columns and an method that filles the static columns. I also can load the datas for each User. now I need to merge them to one big Table.The main Problem is now: How to put the "Userdata" and the static content in one datagrid.


is that the only way of displaying this information ?

2019年04月22日14分02秒

I´m not sure what your asking for.

1970年01月01日00分01秒

Johannes see my answer, so that you can see why I was asking that.

2019年04月22日14分02秒

I found the DataTable approach to be the easiest and most efficient solution.

2019年04月22日14分02秒

Has anyone successfully auto-generated columns in the DataGrid using method 3?I already have a custom type descriptor defined, I can bind to its properties just fine, but auto-generating columns is not working.

2019年04月22日14分02秒

what ifwe want to edit and update values in the same data grid

2019年04月22日14分02秒

This only seems to work if the data columns are added before the control is initialized.If you change the columns later how do you get that to be reflected in the grid?

2019年04月22日14分02秒

Tough one, I don't know off hand.Call InvalidateVisual maybe?

2019年04月22日14分02秒

I will test this, as soon as i have time, but it looks like it could work.I don't like, that you have to access the DataGrid in the code behind, but since most other solutions do that as well, it does not seem like there is a way arount that.I guess it's possible though to make a custom control of it. I might try implementing one and post it here, when I have time to get to it.

2019年04月22日14分02秒

Would be very interested if u can make a custom Control out of it. That would help me a lot.

2019年04月22日14分02秒

Well I dont think this will solve my Problem. I have one big Table that containes some Data (No matter whitch) now I need to compare multiple Names with the records. So for each record i need "N" more Colummns to directly compare two or more Persons. e. g. : Record 1: 1;tmp.png;Foo;bar;succeeded;not succeeded Record 2: 2;tmp2.png;Foo1;bar2;not succeeded;succeeded

2019年04月22日14分02秒