Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am working on a project which is on college.In this project am creating a page for attendance and attendance report.In the attendance report page i need to bind the date column three times to the gridview by keeping the name column constant for it.Please suggest me some code ....quickly.
Posted
Comments
King Fisher 1-Dec-14 6:02am    
what have you tried so far?

1 solution

select your columns from SQL by naming as date1, date2 and Date3 and in front end for gridview change their caption have the name as date only.

add something like this in your gridview columns section for adding single column multiple times.


C#
<asp :BoundField HeaderText="Date 1" DataField="Date" />
<asp :BoundField HeaderText="Date 2" DataField="Date" />
<asp :BoundField HeaderText="Date 3" DataField="Date" />
 
Share this answer
 
v4
Comments
Member 10486850 1-Dec-14 6:13am    
Actually m having a single column i.e date which i need to bind multiple times to the gridview ....
Shweta N Mishra 1-Dec-14 6:18am    
you can do that in gridview. To do that first bind your gridview from dataset returned from SQL and then add columns to Gridview and give the column value to have the Date column value.

check this

http://www.c-sharpcorner.com/uploadfile/61b832/adding-bound-columns-to-gridview-in-Asp-Net/
Member 10486850 1-Dec-14 6:19am    
Please can you suggest the code for the above issue....as earlier...
Shweta N Mishra 1-Dec-14 6:21am    
add something like this in your gridview columns section



<asp datafield="Date" headertext="Date 1" :boundfield="Date">

<asp datafield="Date" headertext="Date 2" :boundfield="Date">
<asp datafield="Date" headertext="Date 3" :boundfield="Date">
Member 10486850 2-Dec-14 2:07am    
Your suggested solution is not able to vieww...m nt able to see anythg

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