How to display empty dates in ListView?


Author
Message
Larry Tucker
Larry Tucker
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Hi Edhy,

Thank you for following up about the display issue.  That solved it.

BTW, how are you formatting the code and uploading the screen shots in your replies?  They are very clear. Is there a Forum guide somewhere that explains this?

Larry
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Larry,
Here is what you need to do to get your empty dates to be shown as blank in the listview:
  • In the ListView Population Setting, set the "Population Type" of the date column to be "PopulatedThroughEvent
http://forum.strataframe.net/Uploads/Images/a10854a9-10cf-487f-bc58-8067.png
  • Create a handle for the Listview.RowPopulating and enter code like this:

    Private Sub ListView1_RowPopulating(e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgsHandles ListView1.RowPopulating
         Using bo As bizCustomers = CType(e.BusinessObject, bizCustomers)
             If bo.cust_Created = #1/1/1800# Then
                 e.Values(2).DisplayValue = String.Empty
             End If
         End Using
     End Sub

That should take care of this issue. Also, if you will be manipulating the data in the listview, I prefer to add an instance of the BO, fill the data of the BO, then requery the ListView using the
BusinessCloneDataType.ClearAndFillFromDefaultView as below and set the ListView.AutoNavigateToSelectedRecord = True

    Private Sub ListView1_ListPopulating(e As MicroFour.StrataFrame.UI.ListPopulatingEventArgsHandles ListView1.ListPopulating
         e.Parameters(0).Value = Me.BizCustomers1
         e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView
     End Sub



Edhy Rijo

Larry Tucker
Larry Tucker
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Edhy,

Was nice chatting just now. 

As for the display issue, I think I've got the BO translation working but it still shows in the ListView as 1/1/1800.

(Am trying to upload a screen shot here).

Will keep poking around at the problem...

Larry
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Larry,
Larry Tucker (3/2/2012)
... I see you've really mastered SF... and are continuing to help a lot in the forum.


Mastered SF, No really, still have a lot to learn.  Just that by using it almost every day you get more familiar with the tools Smile

I noticed you mentioned IronSpeed, if you don't mind, I would like to know about your experience with it, I will send you a private message with my phone.

Edhy Rijo

Larry Tucker
Larry Tucker
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Hi Edhy,

It is good to be back.  And I see you've really mastered SF... and are continuing to help a lot in the forum.

This is just what I needed.  Excellent.  Thanks.

Larry
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Larry,
Welcome back!!!

Well, StrataFrame handle this situation very easy via the "NULL Value Option" in the "Custom Field Properties" in the Business Object Mapper.  Just select a null option like "Return Altername on Null" and set it to the empty date value like this: New Date(1800,1,1) so when you get a Null date from SQL Server, you are actually getting 1/1/1800 and SF will translate that for you in every SF control including the ListView, so you don't have to anything else.
http://forum.strataframe.net/Uploads/Images/3d9951a5-1f50-43bb-a24d-ceca.png

Edhy Rijo

Larry Tucker
Larry Tucker
StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)StrataFrame User (135 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Well, I'm back to SF after a few years and some other adventures (an Ironspeed web app, some data mining experience...) and am converting a VFP (VPME) application.  (Hello to some old VPME'ers out there like Edhy).  I'm really liking the core SF functionality but have some questions around the fringes.

So my first question concerns displaying empty dates.  I see that the DateBox is now the preferred way of editing dates and it has an EmptyValue property for trapping a place holder value (like '1/1/1800') and displaying it as blank. 

What is the best way to trap and hide these place holder dates in other places, such as in ListView columns?  I see I have two options to format a column:  Format String and PopulatedThroughEvent.  I suspect the preferred way is to use PopulatedThroughEvent to trap the place holder date value and return a "" string.  Is that about right?  Any examples?

Thanks in advance,

Larry
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