|
-
Dec 5th, 2014, 10:18 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] How to programmatically add columns with data to listview or datagridview?
Hi!
I have a small issue I have been working on.
A UI has a search button and a couple of check boxes. Depending on what check boxes are checked, certain columns of data sould be listed in the "grid".
SInce even the column title is dynamically based on the data (show sums and stuff) I would prefer to do it like this:
create column
set title
set all cells/rows
add to grid
I have been messing with the listview a few hours now and can't find a way to do this in a good way, with a minimum amount of code. All my attempts have been unsuccessful. I would love to do this:
listview1.Columns(calculatedColumnText).rows.addrange(result.Select(x => x.dataforcol1).ToArray().
But the above statement exist only in my dreams...
Anyone, please help!
/Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|