Substituting Values or Controls in Listview


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I have a listview populated at the with CopyDataFrom. There is one field that is a bit, I would like to show either a checkbox with the correct checked status, a 'Y' or 'N' character, or an image (red X, green check) instead of the 0 or 1 value in the table.



Can this be done and can you point me in the right direction?

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Opps I forgot, I would also like to sort listview columns when I click the column header. This is all stuff I used to do standard in a VFP grid, I would like to be able to use SF controls whenever possible though.

Keith Chisarik
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can only show an image for the field if it is the first column in the list view (the icon column); in which case, you have to set the ImageKey or ImageIndex within the RowPopulating event of the listview.  As for displaying an alternate value, you will need to set the column to PopulatedThroughEvent within the PopulationDataSourceSettings.  Once that is set, you can manually specify the display value for the column through the RowPopulating event.

To sort a list, you will need to add a handler to the ColumnClick event of the list view and set the ListViewItemSorter property of the list view to a new instance of the MicroFour.StrataFrame.UI.Windows.Forms.ListViewColumnSorter class and specify the column and the direction to sort by.  You might also have to explicitly call Sort() on the listview, but I don't think so... it should automatically sort when you set the sorter.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search