PC Review


Reply
Thread Tools Rate Thread

how to add record programmatically to datagrid

 
 
jaYPee
Guest
Posts: n/a
 
      22nd Nov 2004
Anyone know how to add record to a datagrid programmatically?

Say for example I have two textboxes in my form and a datagrid. When I
click a button the value of two textboxes will be added as a new row
to my datagrid.

Thanks in advance.
 
Reply With Quote
 
 
 
 
chandan
Guest
Posts: n/a
 
      22nd Nov 2004

"jaYPee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Anyone know how to add record to a datagrid programmatically?
>
> Say for example I have two textboxes in my form and a datagrid. When I
> click a button the value of two textboxes will be added as a new row
> to my datagrid.
>
> Thanks in advance.


HI ,
Its simple u just put it in DATASET
and bind the data grid with the dataset
Add the items in Dataset Datatable
In data table add new row.


 
Reply With Quote
 
jaYPee
Guest
Posts: n/a
 
      22nd Nov 2004
I have already tried this w/ dataset but the problem is it doesn't
work w/ the grand child of my relationship

I have ask this before but doesn't recieved any response. here's the
question I made before.

My problem now is on how can I solve the problem when adding
a new record to my table.

This is my source code that works perfectly if I set the table to
"SchYrSemCourseJoin"

Dim dr As DataRow =
DsStudentCourse1.Tables("SchYrSemCourseJoin").NewRow()
dr("CourseID") = intcourse + 1

DsStudentCourse1.Tables("SchYrSemCourseJoin").Rows.Add(dr)

This code works perfectly if the datamember of my datagrid is set to
"SchYrSemCourseJoin". However because I am using a parent/child form
so the actual datamember of my datagrid is
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJoin" and the
datasource is "DsStudentCourse1"

My purpose with this code is to add a new row to a datagrid.



On Mon, 22 Nov 2004 11:20:50 +0530, "chandan" <(E-Mail Removed)> wrote:

>
>"jaYPee" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> Anyone know how to add record to a datagrid programmatically?
>>
>> Say for example I have two textboxes in my form and a datagrid. When I
>> click a button the value of two textboxes will be added as a new row
>> to my datagrid.
>>
>> Thanks in advance.

>
>HI ,
>Its simple u just put it in DATASET
>and bind the data grid with the dataset
>Add the items in Dataset Datatable
>In data table add new row.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Add an new row in DataGrid programmatically? =?Utf-8?B?Tmlja3k=?= Microsoft ASP .NET 1 26th Feb 2005 10:17 AM
How do I programmatically scroll the datagrid? =?Utf-8?B?QW50aG9ueSBNb3JnYW4=?= Microsoft VB .NET 4 17th Jan 2005 08:31 PM
Re: Sorting a DataGrid programmatically ClayB [Syncfusion] Microsoft Dot NET Framework Forms 1 7th Jul 2004 06:47 PM
Re: Sorting a DataGrid programmatically Tim Wilson Microsoft Dot NET Framework Forms 0 7th Jul 2004 06:12 PM
how can I highlight a row in datagrid programmatically?? Jason Microsoft Dot NET Framework Forms 3 16th Jan 2004 08:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:20 PM.