Click here to Skip to main content
16,004,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can i?? Pin
Nissim Salomon10-Dec-08 2:28
Nissim Salomon10-Dec-08 2:28 
QuestionLimiting the number of lines in a TextBox Pin
Dewald10-Dec-08 1:20
Dewald10-Dec-08 1:20 
AnswerRe: Limiting the number of lines in a TextBox Pin
Lev Danielyan10-Dec-08 2:01
Lev Danielyan10-Dec-08 2:01 
GeneralRe: Limiting the number of lines in a TextBox Pin
Luc Pattyn10-Dec-08 2:02
sitebuilderLuc Pattyn10-Dec-08 2:02 
GeneralRe: Limiting the number of lines in a TextBox Pin
Lev Danielyan10-Dec-08 2:05
Lev Danielyan10-Dec-08 2:05 
GeneralRe: Limiting the number of lines in a TextBox Pin
Dewald10-Dec-08 2:23
Dewald10-Dec-08 2:23 
GeneralRe: Limiting the number of lines in a TextBox Pin
Luc Pattyn10-Dec-08 2:28
sitebuilderLuc Pattyn10-Dec-08 2:28 
QuestionC# windows form data grid view issue Pin
AndieDu10-Dec-08 0:59
AndieDu10-Dec-08 0:59 
Hi all,

i am having a data grid view control in my windows form, now i would like to add all rows of data that in dtSearchDetails that i got from here: dtSearchDetails = taSearchDetails.GetDeliveryDetails(id); into my data grid view

here is my code:


DeliveryDetails.tblSearchDeliveryDataTable dtSearchDetails = new DeliveryDetails.tblSearchDeliveryDataTable();using (DeliveryDetailsTableAdapters.tblDeliveryIdByDateTableAdapter taGetId = new DeliveryDetailsTableAdapters.tblDeliveryIdByDateTableAdapter())
{
int id = 0;
dtDetailsByDate = taGetId.GetIdByDate(dtpSearchByDate.Text);
using (DeliveryDetailsTableAdapters.tblSearchDeliveryTableAdapter taSearchDetails = new DeliveryDetailsTableAdapters.tblSearchDeliveryTableAdapter())
{

int n = dgvDeliveryDetails.Rows.Add();

for (int i = 0; i < dtDetailsByDate.Rows.Count; i++) //assume that dtDetailsByDate.Rows.Count = 3

{

id = Convert.ToInt32(dtDetailsByDate.Rows[i][dtDetailsByDate.IDColumn].ToString());

dtSearchDetails = taSearchDetails.GetDeliveryDetails(id);
foreach (DeliveryDetails.tblSearchDeliveryRow dr in dtSearchDetails)
{
dgvDeliveryDetails.Rows[n].Cells[0].Value = dtSearchDetails.Rows[i][dtSearchDetails.ClientCompanyColumn].ToString();

dgvDeliveryDetails.Rows[n].Cells[1].Value = dtSearchDetails.Rows[i][dtSearchDetails.DeliverDateColumn].ToString();
}

however, these codes are not working, the compiler says: there is no row at position 1, and it points to this statement: "dgvDeliveryDetails.Rows[n].Cells[0].Value = dtSearchDetails.Rows[i][dtSearchDetails.ClientCompanyColumn].ToString();"


Thanks heapls

Andie
AnswerRe: C# windows form data grid view issue Pin
SeMartens10-Dec-08 3:12
SeMartens10-Dec-08 3:12 
GeneralRe: C# windows form data grid view issue Pin
AndieDu10-Dec-08 12:42
AndieDu10-Dec-08 12:42 
GeneralRe: C# windows form data grid view issue Pin
SeMartens10-Dec-08 21:14
SeMartens10-Dec-08 21:14 
QuestionDisplay file and folders from computer in treeview with checkbox Pin
kavitaBC9-Dec-08 23:31
kavitaBC9-Dec-08 23:31 
AnswerRe: Display file and folders from computer in treeview with checkbox Pin
N a v a n e e t h9-Dec-08 23:35
N a v a n e e t h9-Dec-08 23:35 
AnswerRe: Display file and folders from computer in treeview with checkbox Pin
Teuz9-Dec-08 23:42
Teuz9-Dec-08 23:42 
QuestionFocus of listview on Vista Pin
Teuz9-Dec-08 23:12
Teuz9-Dec-08 23:12 
QuestionChange a property with strings Pin
softwarejaeger9-Dec-08 22:45
softwarejaeger9-Dec-08 22:45 
AnswerRe: Change a property with strings Pin
Mirko19809-Dec-08 22:59
Mirko19809-Dec-08 22:59 
GeneralRe: Change a property with strings Pin
softwarejaeger9-Dec-08 23:37
softwarejaeger9-Dec-08 23:37 
GeneralRe: Change a property with strings Pin
Mirko19809-Dec-08 23:49
Mirko19809-Dec-08 23:49 
GeneralRe: Change a property with strings Pin
softwarejaeger10-Dec-08 0:15
softwarejaeger10-Dec-08 0:15 
GeneralRe: Change a property with strings Pin
Mirko198010-Dec-08 0:23
Mirko198010-Dec-08 0:23 
GeneralRe: Change a property with strings Pin
softwarejaeger10-Dec-08 0:59
softwarejaeger10-Dec-08 0:59 
GeneralRe: Change a property with strings Pin
Mirko198010-Dec-08 2:08
Mirko198010-Dec-08 2:08 
Questionrealtime price feed Pin
devvvy9-Dec-08 21:59
devvvy9-Dec-08 21:59 
QuestionC# components Pin
Dreekebe9-Dec-08 21:45
Dreekebe9-Dec-08 21:45 

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.