TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bineesh Viswanath
NA
1k
777.7k
c# code to give Gridview cell name to exporting Excel file
Feb 4 2017 7:25 AM
Sir,
I am in winForm project in which I have to export datagridview data into excel sheet.
I have done almost except naming exported excel header columns to that of datagridview.
How can I set column headers to the exported excel file..help me
for (int i = 0; i < dgvBankAllocationReport.Rows.Count; i++)
{
for (int j = 0; j < dgvBankAllocationReport.Columns.Count; j++)
{
if (dgvBankAllocationReport.Rows[i].Cells[j].Value != null)
{
exceObj.Cells[i + 2, j + 1] = dgvBankAllocationReport.Rows[i].Cells[j].Value;
string colName = dgvBankAllocationReport.Columns[j].HeaderText;
}
}
}
Reply
Answers (
1
)
How can we post data for restfull web api.
Alert while clicking the button with matching the gridview l