PisgahMan Posted November 19, 2003 Posted November 19, 2003 is there an easy way to supress repeating rows in a datagrid? For example if 3 rows of data looks like this. Acct No F.Name L.Name Address --------------------------------------------------------------------------- 123456 Johnny Speller 789 Elm Street 654311 Johnny Speller 789 Elm Street 241454 Johnny Speller 789 Elm Street and I want it to display on the page like this: Acct No F.Name L.Name Address --------------------------------------------------------------------------- 123456 Johnny Speller 789 Elm Street 654311 241454 Quote
Moderators Robby Posted November 19, 2003 Moderators Posted November 19, 2003 Yes, but it's not easy. I deal with something similiar here http://www.xtremedotnettalk.com/showthread.php?threadid=78363 Online demo Quote Visit...Bassic Software
mr relaxo Posted November 19, 2003 Posted November 19, 2003 If you're using a dataset you could just loop through it and change repeating values to empty strings before you bind it to your grid. This assumes that you ORDER BY fname. e.g Dim dr As DataRow Dim thisrow, lastrow As String For Each dr In ds.Tables("yourdatatablename").Rows lastrow = thisrow 'set variables to same value thisrow = dr.Item("fname") 'change thisrow to next datarow in the loop If thisrow = lastrow Then 'if they're equal you have repeating values so... dr.Item("fname") = "" dr.Item("lname") = "" etc... End If kinda crude, but its easy. Quote You can not get ye flask.
PisgahMan Posted December 22, 2003 Author Posted December 22, 2003 That worked mr relaxo, thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.