Click here to Skip to main content
15,920,576 members
Home / Discussions / C#
   

C#

 
GeneralRe: WM_PAINT message in textbox Pin
thomus0720-Apr-10 3:46
thomus0720-Apr-10 3:46 
Questionhow can i show progress in Progress bar on MDI form from child form Pin
wasifmuneer19-Apr-10 21:58
wasifmuneer19-Apr-10 21:58 
AnswerRe: how can i show progress in Progress bar on MDI form from child form Pin
Anindya Chatterjee20-Apr-10 0:09
Anindya Chatterjee20-Apr-10 0:09 
AnswerRe: how can i show progress in Progress bar on MDI form from child form Pin
StM0n20-Apr-10 1:05
StM0n20-Apr-10 1:05 
AnswerRe: how can i show progress in Progress bar on MDI form from child form Pin
wasifmuneer20-Apr-10 20:35
wasifmuneer20-Apr-10 20:35 
QuestionJPEG deinterlacing Pin
Chesnokov Yuriy19-Apr-10 21:13
professionalChesnokov Yuriy19-Apr-10 21:13 
QuestionRe: JPEG deinterlacing Pin
Chesnokov Yuriy19-Apr-10 22:16
professionalChesnokov Yuriy19-Apr-10 22:16 
QuestionExporting Datagridview Headers to excel Pin
ZiggyNet19-Apr-10 20:33
ZiggyNet19-Apr-10 20:33 
Hi Develepers

I have created a C# windows application that is able to export a Dataset that i can view on a datagridview to excel using excel Application in visual studio.

I have done this using Microsoft Interop Reference.

However i am unable to export the datagridview headers to the excel worksheet so that the users are able to see what the data is.

int i = 0;<br />
      int j = 0;<br />
<br />
         for (i = 0; i <= dtgView.RowCount -1; i++)<br />
              {<br />
            for (j = 0; j <= dtgView.ColumnCount-1; j++)<br />
               {<br />
              DataGridViewCell dtgcell = dtgView[j, i];<br />
              excelWorksheet.Cells[i+2, j+1] = dtgcell.Value.ToString();<br />
                  }<br />
                   }



May you please give me tips on how to add the headers to the excel worksheet.
AnswerRe: Exporting Datagridview Headers to excel Pin
Mycroft Holmes19-Apr-10 22:40
professionalMycroft Holmes19-Apr-10 22:40 
RantRe: Exporting Datagridview Headers to excel Pin
ZiggyNet20-Apr-10 3:46
ZiggyNet20-Apr-10 3:46 
GeneralRe: Exporting Datagridview Headers to excel Pin
Mycroft Holmes20-Apr-10 12:25
professionalMycroft Holmes20-Apr-10 12:25 
QuestionWhy the form be changed? [modified][Solved] Pin
yu-jian19-Apr-10 20:21
yu-jian19-Apr-10 20:21 
QuestionRe: Why the form be changed? Pin
Michel Godfroid19-Apr-10 20:37
Michel Godfroid19-Apr-10 20:37 
AnswerRe: Why the form be changed? Pin
Mycroft Holmes19-Apr-10 22:42
professionalMycroft Holmes19-Apr-10 22:42 
GeneralRe: Why the form be changed? Pin
yu-jian20-Apr-10 6:58
yu-jian20-Apr-10 6:58 
QuestionBlock a method execution Pin
Hum Dum19-Apr-10 18:59
Hum Dum19-Apr-10 18:59 
QuestionRe: Block a method execution Pin
Michel Godfroid19-Apr-10 19:41
Michel Godfroid19-Apr-10 19:41 
AnswerRe: Block a method execution Pin
Hum Dum19-Apr-10 20:00
Hum Dum19-Apr-10 20:00 
QuestionRe: Block a method execution Pin
Michel Godfroid19-Apr-10 20:23
Michel Godfroid19-Apr-10 20:23 
GeneralRe: Block a method execution Pin
Luc Pattyn20-Apr-10 1:11
sitebuilderLuc Pattyn20-Apr-10 1:11 
GeneralRe: Block a method execution Pin
Hum Dum20-Apr-10 1:45
Hum Dum20-Apr-10 1:45 
GeneralRe: Block a method execution Pin
Luc Pattyn20-Apr-10 1:56
sitebuilderLuc Pattyn20-Apr-10 1:56 
AnswerRe: Block a method execution Pin
Calla19-Apr-10 20:08
Calla19-Apr-10 20:08 
GeneralRe: Block a method execution Pin
Hum Dum19-Apr-10 20:18
Hum Dum19-Apr-10 20:18 
GeneralRe: Block a method execution Pin
Calla19-Apr-10 20:39
Calla19-Apr-10 20:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.