Profile Picture

NTreelist formatting Date

Posted By Gary Smith 15 Years Ago
Author
Message
Gary Smith
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 39, Visits: 1

Utilizing the NTreelist, and binding (via your sample) to a microsoft access query, I am returning the date as a vbShortDate, however when displayed - the time (12:00:00) is added.... How can I format the date so it only shows as whats returned from the query?

Thanks

 



Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Gary,

In this case you will have to subclass the NTreeListTableData class by the following way:

Public Class MyNTreeListTableData

   Inherits NTreeListTableData

    Protected Overrides Function CreateSubItem(ByVal value As Object) As Nevron.UI.WinForm.Controls.NTreeListNodeSubItem

        Dim item As NTreeListNodeSubItem = MyBase.CreateSubItem(value)

        If value.GetType() Is GetType(DateTime) Then

            item = New NTreeListNodeStringSubItem()

            TryCast(item, NTreeListNodeStringSubItem).Text = CDate(value).ToShortDateString()

        End If

        Return item

    End Function

End Class

This way you will be able to manage the visual representation of the DateTime item.

Regards,

Angel.

 



Gary Smith
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 39, Visits: 1

Thanks Angel, I'll give this a try once I get the controls installed....

I upgraded a new machine to windows 7 and the controls install, but they are not available in studio 2008.

Gary

 



Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Gary,

The problem might be because you are trying to install .NET Vision for VS2005. We have separate installations for VS2005 and VS2008.

You can download the VS2008 version from our download page:

http://nevron.com/Downloads.Download.aspx

 

Regards,

Angel.



Gary Smith
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 39, Visits: 1

I dont know how I missed that Angel. I'm downloading the 2008 version now... will update after I get it installed. Thanks!

 



Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Gary,

Both can work together. You can keep Nevron .NET Vision for  VS2005 installed if you are going to use VS2005. Otherwise you can uninstall it.

Regards,

Angel.



Gary Smith
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 39, Visits: 1

Thanks Angel, but I dont even have vs2005...lol... Installing the 2008 version solved the problem. Thanks again...

 

Gary

 



Gary Smith
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 39, Visits: 1

Hi Angel, Got all my other issues taken care of and now I'm dealing with the treelist again.

 

MyNTreeListTableData

I attempted to utilize this function you provided, but I have no idea how or where to use it. Can you explain?  Is there any documentation on the Tree List? I couldnt find any.... But if you can explain how to utilize the formating sub class you provided I would be much appreciative! Thanks!

 

Gary

 



Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Gary,

When you try to bind data to NTreeList you usually do the following:

Dim data As NTreeListTableData = New NTreeListTableData()

data.Table = myDataTable

data.Bind(NTreeList1)

Now instead of using NTreeListTableData use the class above (MyNTreeListTableData):

Dim data As MyNTreeListTableData = New MyNTreeListTableData()

data.Table = myDataTable

data.Bind(NTreeList1)

And because in MyNTreeListTableData the way DateTime type is displayed was overridden with the desired DateTime format, your DateTime values will be displayed in this format.

Regards,

Angel.



Gary Smith
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)Forum Member (39 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 39, Visits: 1

Perfect Angel... just as I needed... Thanks for the explanation, as usual - you guys are right there..!

Appreciate it!

Gary

 





Similar Topics


Reading This Topic