-
hide duplicate rows in asp.net
I have a column structure in gridview
account dept1 dept2 dept3
1 1
1 1
1 1
2 12
3 1
3 12
These rows are different records from database.
I want to have
account dept1 dept2 dept3
1 1 1 1
2 12
3 1 12
Is there a way to hide rows and display data correctly.
Right now I have data in a dataset in c#.
-
And are you building your dataset through an SQL query to your backend database?
If so, then that is where the filtering would be going on and the gridview would be used just for display purposes.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
yes I use gridview to display the result.. but its an aspxgridview. but as far as i can make dataset schemna proper it will display well. I thought of cloning the database and adding new columns and displaying result, but have not been successful
-
This will solve the prblem:
Public Shared Sub RemoveDuplicateItems(ByVal ddl As DropDownList)
Dim i As Integer = 0
While i < ddl.Items.Count
ddl.SelectedIndex = i
Dim str As String = ddl.SelectedItem.ToString()
Dim counter As Integer = i + 1
While counter < ddl.Items.Count
ddl.SelectedIndex = counter
Dim compareStr As String = ddl.SelectedItem.ToString()
If str = compareStr Then
ddl.Items.RemoveAt(counter)
counter = counter - 1
End If
System.Math.Max(System.Threading.Interlocked.Increment(counter), counter - 1)
End While
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
End Sub
Call function as:
RemoveDuplicateItems(DropDownList1)
-
I am not working on dropdownlist. So I am not sure how will it solve my issue
Similar Threads
-
By crystalelle in forum .NET
Replies: 4
Last Post: 03-18-2008, 11:25 AM
-
By crystalelle in forum .NET
Replies: 6
Last Post: 03-01-2008, 01:05 PM
-
By iluvtorrent in forum Database
Replies: 7
Last Post: 12-12-2007, 07:30 AM
-
By v_gyku in forum VB Classic
Replies: 2
Last Post: 09-03-2005, 07:45 AM
-
By Jeff Powell Jonsson in forum VB Classic
Replies: 0
Last Post: 07-18-2002, 02:55 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks