Format DataGrid Columns - WinForms / VB.Net





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

6
Date Submitted Fri. Oct. 13th, 2006 10:01 AM
Revision 1
Beginner nothingHappens
Tags ActionScript | DataGrid | Flash | sorting
Comments 0 comments
I think that the problem comes when you populate a DataGrid's dataProvider with data from a a remoting call, such as a RecordSet returned from AMFPHP. The remoting protocol doesn't remember the datatype of each database column, so once you get the RecordSet back to ActionScript everything has become a String. You could go to the trouble of casting every numeric column's contents in the RecordSet to a Number so that the DataGrid will sort those columns numerically (1, 2, 3, ...) rather than lexicographically (1, 10, 11, ..., 2, 20, ...)... or you could throw this quick little function in and tell it which columns you consider numeric. It will replace the default sorting behavior with one that casts to numbers before comparing, when dealing in the columns you specify. Pass it an array of the columns' indices and the DataGrid in question. Non-numeric strings in the columns you specify will get treated as 0 and left unsorted at the top.
5
Date Submitted Thu. Sep. 21st, 2006 7:48 AM
Revision 1
Scripter Pio
Tags math | Percent | VB.NET
Comments 2 comments
Returns a percentage. There are 3 arguments.

1. complete - How much is done?
2. total - How much is there?
3. maxPercentage - Total percentage possible, usually 100.

Simple, yep.
5
Date Submitted Fri. Sep. 8th, 2006 7:05 PM
Revision 1
Helper jbplou
Tags net | VB.NET
Comments 0 comments
Returns a string collection of IP addresses for a passed in domain name.
5
Date Submitted Mon. Sep. 18th, 2006 6:59 PM
Revision 1
Helper jbplou
Tags VB.NET
Comments 0 comments
Counting for loop in VB.NET. Looks easy because it is, but I saw one submitted for PHP.
4
Date Submitted Thu. Sep. 21st, 2006 7:30 AM
Revision 1
Scripter Pio
Tags ArrayList | System.IO | VB.NET
Comments 3 comments
Loading and Saving an ArrayList to/from any given path.
4
Date Submitted Sat. Sep. 9th, 2006 9:22 PM
Revision 1
Helper jbplou
Tags String | VB.NET
Comments 2 comments
This function provides the reverse of a string. It is constructed using string builder because strings in .NET are immutable, while stringbuilders are not. Therefore large strings could be slow to reverse if a regular string was used for the working value that is returned.
3
Date Submitted Sat. Oct. 15th, 2005 5:32 PM
Revision 1
Helper ses5909
Tags Directory | Files | List | VB.NET
Comments 1 comments
List Files in a Directory in VB.NET
3
Date Submitted Tue. Jun. 13th, 2006 3:21 PM
Revision 1
Helper gbarendt
Tags enum | String | VB.NET
Comments 0 comments
Given a string, you can return an Enum value

Originally found at http://codeproject.com/dotnet/EnumTips.asp?df=100&forumid=38264&exp=0&select=797671
3
Date Submitted Sat. Sep. 9th, 2006 11:10 AM
Revision 1
Helper jbplou
Tags Exception | VB.NET
Comments 1 comments
This function returns a stack trace for an exception with all inner exceptions include unless the count of inner exceptions goes over 50. A stack overflow can occur if there is no upper limit for inner exceptions to read from.

Makes use of stringbuilder to build return string in order to yield higher performance.
-1
Date Submitted Tue. Oct. 11th, 2005 9:53 PM
Revision 1
Helper ses5909
Tags Email | Send | VB.NET
Comments 1 comments
Send Basic Email