J
John Walker
Hi,
In ASP.NET 2.0 I have a class called Cols (shown below) which keeps a record
of the different columns in my gridview. I need this because sometimes I
need to show/hide columns and need to know their position. One problem with
this is that whenever we add a column to the gridview i need to add it to
this Cols class and if it's at the beginning then every column after it has
to be renumbered.
Is there a way to somehow have the Cols fields auto number themselves, or is
there an overall better way to keep track of your columns so it's easy to
locate them for showing/hiding?
Public Class Cols
Public Shared Office As Int16 = 1
Public Shared TruckerName As Int16 = 2
Public Shared TruckerCode As Int16 = 3
Public Shared TotalContainers As Int16 = 4
Public Shared DOsNotReceived As Int16 = 5
Public Shared DOsNotReceived__Pct As Int16 = 6
Public Shared DOsPastDue As Int16 = 7
Public Shared DOsPastDue__Pct As Int16 = 8
Public Shared ContainersNotPickedUp As Int16 = 9
Public Shared ContainersNotPickedUp__Pct As Int16 = 10
Public Shared ContainersNotDelivered As Int16 = 11
Public Shared ContainersNotDelivered__Pct As Int16 = 12
Public Shared EmptiesNotPU As Int16 = 13
Public Shared EmptiesNotPU__Pct As Int16 = 14
Public Shared EmptiesNotReturned As Int16 = 15
Public Shared EmptiesNotReturned__Pct As Int16 = 16
Public Shared TotalMean As Int16 = 17
End Class
Thanks,
John
In ASP.NET 2.0 I have a class called Cols (shown below) which keeps a record
of the different columns in my gridview. I need this because sometimes I
need to show/hide columns and need to know their position. One problem with
this is that whenever we add a column to the gridview i need to add it to
this Cols class and if it's at the beginning then every column after it has
to be renumbered.
Is there a way to somehow have the Cols fields auto number themselves, or is
there an overall better way to keep track of your columns so it's easy to
locate them for showing/hiding?
Public Class Cols
Public Shared Office As Int16 = 1
Public Shared TruckerName As Int16 = 2
Public Shared TruckerCode As Int16 = 3
Public Shared TotalContainers As Int16 = 4
Public Shared DOsNotReceived As Int16 = 5
Public Shared DOsNotReceived__Pct As Int16 = 6
Public Shared DOsPastDue As Int16 = 7
Public Shared DOsPastDue__Pct As Int16 = 8
Public Shared ContainersNotPickedUp As Int16 = 9
Public Shared ContainersNotPickedUp__Pct As Int16 = 10
Public Shared ContainersNotDelivered As Int16 = 11
Public Shared ContainersNotDelivered__Pct As Int16 = 12
Public Shared EmptiesNotPU As Int16 = 13
Public Shared EmptiesNotPU__Pct As Int16 = 14
Public Shared EmptiesNotReturned As Int16 = 15
Public Shared EmptiesNotReturned__Pct As Int16 = 16
Public Shared TotalMean As Int16 = 17
End Class
Thanks,
John