In a web application I am binding the data to a GridView. In the GridView some of data is repeating. I want to not display the data again and again.
For example Empid is displaying more than one time in the same column. I want to not display the empid again in that column.
You can implement the
OnDataBindingevent for the specific column you are using. I never useAutoGenerateColumnsso having fine control of each cell is pretty simple to implement.Eg:
Define your column like:
Then just implement your
DataBindingevent:The
RowDataBoundforces you to search for controls and if changes are required in the future you have the possibility of breaking other things being modified within the event. Because of this, I prefer to use the control’sDataBindingevent whenever possible as it localizes functionality to only the control and gives you the flexability to swap out controls and functionality easily without the worry off affecting other things.