Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralOwner Pin
ellllllllie28-Mar-08 2:46
ellllllllie28-Mar-08 2:46 
GeneralRe: Owner Pin
Thomas Stockwell28-Mar-08 3:05
professionalThomas Stockwell28-Mar-08 3:05 
GeneralRe: Owner Pin
ellllllllie28-Mar-08 3:38
ellllllllie28-Mar-08 3:38 
GeneralCode to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Walaza28-Mar-08 2:42
Walaza28-Mar-08 2:42 
GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Thomas Stockwell28-Mar-08 3:09
professionalThomas Stockwell28-Mar-08 3:09 
GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Walaza28-Mar-08 3:58
Walaza28-Mar-08 3:58 
GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Thomas Stockwell28-Mar-08 8:18
professionalThomas Stockwell28-Mar-08 8:18 
GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Walaza30-Mar-08 20:17
Walaza30-Mar-08 20:17 
Hi,
Thanks again for the reply.
Did you mean something like this:
for (int i = 0; i < ((DataGridView)this.dgOutput).Columns.Count; i++)
{
r[1, i + 1] = ((DataGridView)this.dgOutput).Columns[i].HeaderText.ToString();
((Range)r.Cells[1, i + 1]).Font.Bold = true;

for (int j = 0; j < ((DataGridView)this.dgOutput).Columns.Count; i++)
{
r[1, j + 1] = ((DataGridView)this.dgOutput).Columns[j].ToString();
}
}
The inner for loop does not print the cells and throws the ff exception:
HRESULT: 0x800AC472

Regards,

Mvelo Walaza
Developer
Telkom SA

GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Thomas Stockwell31-Mar-08 3:46
professionalThomas Stockwell31-Mar-08 3:46 
GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
Walaza31-Mar-08 4:28
Walaza31-Mar-08 4:28 
GeneralRe: Code to: Loop through a datagrid and display its data in a new Excel spreadsheet Pin
MumbleB28-Mar-08 3:31
MumbleB28-Mar-08 3:31 
GeneralFlashy GDI+ Pin
Reelix28-Mar-08 2:20
Reelix28-Mar-08 2:20 
GeneralRe: Flashy GDI+ Pin
c242328-Mar-08 6:41
c242328-Mar-08 6:41 
QuestionRead,write and save the configuration file likely named as "logger.exe.config"------------- Please Help anyone,its urgent Pin
BhuMan28-Mar-08 2:05
BhuMan28-Mar-08 2:05 
GeneralRe: Read,write and save the configuration file likely named as "logger.exe.config"------------- Please Help anyone,its urgent Pin
Reelix28-Mar-08 2:12
Reelix28-Mar-08 2:12 
GeneralRe: Read,write and save the configuration file likely named as "logger.exe.config"------------- Please Help anyone,its urgent Pin
BhuMan30-Mar-08 18:34
BhuMan30-Mar-08 18:34 
QuestionDDL Creation Pin
kontax28-Mar-08 1:11
kontax28-Mar-08 1:11 
GeneralRe: DDL Creation Pin
Reelix28-Mar-08 1:23
Reelix28-Mar-08 1:23 
GeneralRe: DDL Creation Pin
kontax28-Mar-08 1:29
kontax28-Mar-08 1:29 
GeneralRe: DDL Creation Pin
Reelix28-Mar-08 1:43
Reelix28-Mar-08 1:43 
GeneralRe: DDL Creation Pin
kontax28-Mar-08 2:29
kontax28-Mar-08 2:29 
GeneralRe: DDL Creation Pin
darkelv28-Mar-08 2:38
darkelv28-Mar-08 2:38 
GeneralRe: DDL Creation Pin
kontax28-Mar-08 6:12
kontax28-Mar-08 6:12 
Generalextender desktop Pin
ellllllllie28-Mar-08 0:26
ellllllllie28-Mar-08 0:26 
Generalnested foreach obj1 in obj2 Issue Pin
Harvey Saayman28-Mar-08 0:13
Harvey Saayman28-Mar-08 0:13 

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.