Click here to Skip to main content
15,506,025 members
Home / Discussions / C#
   

C#

 
AnswerRe: Payment Using Visa Cards Pin
V.11-Feb-14 3:18
professionalV.11-Feb-14 3:18 
AnswerRe: Payment Using Visa Cards Pin
OriginalGriff11-Feb-14 4:03
mveOriginalGriff11-Feb-14 4:03 
GeneralRe: Payment Using Visa Cards Pin
Dave Kreskowiak11-Feb-14 8:27
mveDave Kreskowiak11-Feb-14 8:27 
JokeRe: Payment Using Visa Cards Pin
AmitGajjar11-Feb-14 21:00
professionalAmitGajjar11-Feb-14 21:00 
GeneralRe: Payment Using Visa Cards Pin
Dave Kreskowiak12-Feb-14 5:22
mveDave Kreskowiak12-Feb-14 5:22 
GeneralRe: Payment Using Visa Cards Pin
V.11-Feb-14 21:28
professionalV.11-Feb-14 21:28 
AnswerRe: Payment Using Visa Cards Pin
GuyThiebaut11-Feb-14 10:54
professionalGuyThiebaut11-Feb-14 10:54 
QuestionIssue in Exporting Column Headers from DatagridView to Excel Pin
Mohan Subramani11-Feb-14 2:22
Mohan Subramani11-Feb-14 2:22 
Hey Guys,

I need your assistance, am struck up with an issue.
Issue: I have retrived a SQL data into a DataGridView, It has the below column header names like (Package_ID, Package_Name etc.)

I used the below code to copy the data in DataGridview to Excel.
Copying is fine, but am not getting the colum headers which are visible in my DatagridView. (Package_ID, Package_Name etc.)

Other than the Column headers all other data are getting copied.

the code i used:

private void copyAlltoClipboard()
{
dataGridView1.SelectAll();
DataObject dataObj = dataGridView1.GetClipboardContent();
if (dataObj != null)
Clipboard.SetDataObject(dataObj);
}

private void btn_Export_Click(object sender, EventArgs e)
{
copyAlltoClipboard();
Microsoft.Office.Interop.Excel.Application xlexcel;
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
xlexcel = new Excel.Application();
xlexcel.Visible = true;
xlWorkBook = xlexcel.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
Excel.Range CR = (Excel.Range)xlWorkSheet.Cells[1, 1];
CR.Select();
xlWorkSheet.PasteSpecial(CR, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, true);
}


i want my column headers also need to be copied to Excel.
Please assist.
AnswerRe: Issue in Exporting Column Headers from DatagridView to Excel Pin
Eddy Vluggen11-Feb-14 4:01
professionalEddy Vluggen11-Feb-14 4:01 
AnswerRe: Issue in Exporting Column Headers from DatagridView to Excel Pin
Chris Quinn11-Feb-14 6:07
Chris Quinn11-Feb-14 6:07 
Generaldatagridview c# Pin
saharmirzaei11-Feb-14 0:49
saharmirzaei11-Feb-14 0:49 
GeneralRe: datagridview c# Pin
Eddy Vluggen11-Feb-14 4:00
professionalEddy Vluggen11-Feb-14 4:00 
Generaldatagridview Pin
saharmirzaei11-Feb-14 0:48
saharmirzaei11-Feb-14 0:48 
QuestionHelp Provider Pin
kwinko10-Feb-14 20:13
kwinko10-Feb-14 20:13 
AnswerRe: Help Provider Pin
OriginalGriff10-Feb-14 21:37
mveOriginalGriff10-Feb-14 21:37 
QuestionWhat is the purpose of a .edmx file? Pin
Xarzu10-Feb-14 15:40
Xarzu10-Feb-14 15:40 
AnswerRe: What is the purpose of a .edmx file? Pin
Snehasish_Nandy10-Feb-14 19:39
professionalSnehasish_Nandy10-Feb-14 19:39 
AnswerRe: What is the purpose of a .edmx file? Pin
Nicholas Marty10-Feb-14 22:38
professionalNicholas Marty10-Feb-14 22:38 
QuestionReading and writing USB HID FeatureReports async. Pin
BigBenDk10-Feb-14 6:34
BigBenDk10-Feb-14 6:34 
AnswerRe: Reading and writing USB HID FeatureReports async. Pin
Jason Gleim10-Feb-14 10:22
professionalJason Gleim10-Feb-14 10:22 
GeneralRe: Reading and writing USB HID FeatureReports async. Pin
BigBenDk10-Feb-14 11:26
BigBenDk10-Feb-14 11:26 
GeneralRe: Reading and writing USB HID FeatureReports async. Pin
Jason Gleim10-Feb-14 11:38
professionalJason Gleim10-Feb-14 11:38 
AnswerRe: Reading and writing USB HID FeatureReports async. Pin
Bernhard Hiller10-Feb-14 22:21
Bernhard Hiller10-Feb-14 22:21 
QuestionSOAP from scratch? Pin
Antessima10-Feb-14 5:41
Antessima10-Feb-14 5:41 
AnswerRe: SOAP from scratch? Pin
jschell10-Feb-14 9:11
jschell10-Feb-14 9:11 

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.