Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all.

Thanks to code project i can view a datagrid, hide duplicate values and also print it as well.

My challenge is i have hidden datagrid duplicate values in the data grid but when i print the datagridview, the hidden values still appear

i need code to hide them when am printing as well

----------------------

Further clarification from OP :

I am ok with hiding and showing columns. My challenge is if a column has duplicate data and i dont whant it to be repeated
eg
NAME STATUS ITEM
francis purchase1 book1
francis purchase2 book2
francis purchase3 book3
Justine purchase1 book1
Justine purchase2 book2
Justine purchase3 book3


i have managed to do a datagridview where the above datagridview appears as below i.e hiding the duplicate values

NAME STATUS ITEM
francis purchase1 book1
purchase2 book2
purchase3 book3
Justine purchase1 book1
purchase2 book2
purchase3 book3

But when i print the datagridview, i still get the full datagrid with the duplicate values as below

NAME STATUS ITEM
francis purchase1 book1
francis purchase2 book2
francis purchase3 book3
Justine purchase1 book1
Justine purchase2 book2
Justine purchase3 book3

in my print out

i need the code to hide these duplicates in the printout as in the datagridview

The code i am using i got from
•PrintDGV, adapted from the work of Afrasiab Cheraghi
Posted
Updated 31-Dec-10 1:11am
v2

1 solution

THIS[^] Domestic article will surely help you as in article you will find hidden ID column is not coming in print preview.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900