Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Bineesh Viswanath
1.2k
1k
731.4k
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