StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Substituting Values or Controls in ListviewExpand / Collapse
Author
Message
Posted 09/07/2006 2:22:08 PM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 9:57:58 PM
Posts: 658, Visits: 27,148
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?
Post #2692
Posted 09/07/2006 2:28:52 PM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 9:57:58 PM
Posts: 658, Visits: 27,148
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.
Post #2693
Posted 09/08/2006 8:59:44 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/02/2008 4:42:46 PM
Posts: 2,686, Visits: 1,890
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.


www.bungie.net
Post #2695
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:13am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.062. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.