I am filling a Gridview in ASP 4 vb.
I have a counter in the first column to help users know counts as they choose different options from drop downs. The sort is created when a user clicks on a column heading in the Gridview.
So when they sort the column in Descending order the other rows don’t match up all the way.
It like it gets confused and part way down the order is out of whack.
Only the first column wants to be sorted Descending since I want Vendors, managers and names afterwords sorted alphabetically. this is what seems to get out of sync. the first column appears to sort correctly, it's the others that do not.
Any ideas?
DougP
I have a counter in the first column to help users know counts as they choose different options from drop downs. The sort is created when a user clicks on a column heading in the Gridview.
So when they sort the column in Descending order the other rows don’t match up all the way.
It like it gets confused and part way down the order is out of whack.
Only the first column wants to be sorted Descending since I want Vendors, managers and names afterwords sorted alphabetically. this is what seems to get out of sync. the first column appears to sort correctly, it's the others that do not.
Any ideas?
Code:
Select ROW_NUMBER() OVER (ORDER BY WAG.WeekEndDate ASC, WAG.Vendor ASC, WAG.Manager ASC, WAG.ResourceLastName ASC, WAG.ResourceFirstName ASC) AS Counter, WAGM.Vendor,WAGM.ResourceLastName, WAGM.ResourceFirstName, WAGM.Manager, WAG.TotalHours, Convert(nvarchar(12),WAG.ApprovedDate,101) AS ApprovedDate, Convert(nvarchar(12),WAG.WeekEndDate,101) AS WeekEndDate, 'Timesheet' = Case When WAG.ResourceFirstName IS NULL Then 'NOT IN' Else 'IN' End , convert(nvarchar(12),WAG.TimeSheetSubmittedDate,101) as DateSubmitted From WeekAtAGlanceMissing WAGM left join WeekAtAGlance WAG ON WAGM.ResourceLastName = WAG.ResourceLastName And WAGM.ResourceFirstName = WAG.ResourceFirstName Inner Join SOWResources SOWR on WAGM.ResourceLastName = SOWR.ResourceLastName AND WAGM.ResourceFirstName = SOWR.ResourceFirstName Where SOWR.EndDate = '2100-12-31' And WAGM.Vendor is not null order by WAG.WeekEndDate ASC, WAG.Vendor ASC, WAG.Manager ASC, WAG.ResourceLastName ASC,
WAG.ResourceFirstName ASC;
DougP