473,839 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to add record programmaticall y to datagrid

Anyone know how to add record to a datagrid programmaticall y?

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.
Nov 21 '05 #1
2 2215

"jaYPee" <hi******@yahoo .com> wrote in message
news:dm******** *************** *********@4ax.c om...
Anyone know how to add record to a datagrid programmaticall y?

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.
Nov 21 '05 #2
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
"SchYrSemCourse Join"

Dim dr As DataRow =
DsStudentCourse 1.Tables("SchYr SemCourseJoin") .NewRow()
dr("CourseID") = intcourse + 1

DsStudentCourse 1.Tables("SchYr SemCourseJoin") .Rows.Add(dr)

This code works perfectly if the datamember of my datagrid is set to
"SchYrSemCourse Join". However because I am using a parent/child form
so the actual datamember of my datagrid is
"Students.Stude ntsSchYrSem.Sch YrSemSchYrSemCo urseJoin" and the
datasource is "DsStudentCours e1"

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

On Mon, 22 Nov 2004 11:20:50 +0530, "chandan" <ch*****@sys.co m> wrote:

"jaYPee" <hi******@yahoo .com> wrote in message
news:dm******* *************** **********@4ax. com...
Anyone know how to add record to a datagrid programmaticall y?

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.


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2555
by: MP | last post by:
Hello I want to know how programmatically put the focus on the new record row of a datagrid (the one with the "*" at the bottom of the grid) TIA MP
0
3650
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a datagrid on the left side that lists names and perhaps a couple of other key fields. The user can click on a record in the datagrid, which should automatically pull up details on that record in the various text boxes and other controls on the right...
6
1982
by: ad | last post by:
I use the code to create a DataGrid and filled with data, But the DataGrid1 didn't display in WebForm. How can I display the DataGrid after creating it? DataGrid DataGrid1 = new DataGrid();
0
1360
by: Mark Kamoski | last post by:
Everyone-- I have a DataGrid that is bound at run-time. Upon the click of the Add, a new row is added to the top and it has several types of controls, (but, it is not permissible to use the built-in editing functionality of the DataGrid). The DataGrid is bound.
2
2332
by: Hrvoje Vrbanc | last post by:
Hello all! I have quite an strange question: I'm using DataGrid to display the results of a query stored in a DataSet. I use data binding with DataBinder.Eval statement (like e.g. <%# DataBinder.Eval(Container.DataItem, "ColumnName") %>). Now the tricky part: is it possible to render one more table row for each record that would be span over several columns and contain some further databound informations? What I want to say is that I...
2
991
by: thomas kern | last post by:
hello, i would like to add a new record using a datagrid. the numbers of my columns varies ( can be 4 columns or 10, differs every time). now i tried to put a textbox in the footer and do a autocolumn. problem here is that i would have to add a template-column programmatically or am i wrong? and until now i have no idea how to add a template-column, i know how to add
4
1418
by: RN | last post by:
In certain situations, I add a datagrid and a button beneath it. All programmatically added in the "code behind". I add them to a cell with cell.add(datagrid) and cell.add(button). Take the button for example. Usually, if the button were there statically, in the ASPX "html" code, I would simply put some code I want to run in the button's click routine in my code-behind. But it seems I can't have a button click routine that will...
2
5459
by: Andre Ranieri | last post by:
Hi folks, I have a datagrid which contains a template item checkbox column. I've included a checkbox as a HeaderTemplate item which fires a server-side function to check or uncheck all the values in the underlying datatable column, and resets the binding to the datagrid. The only problem is that, when the user pages back and forth in the datagrid, their selection is overwritten with the default selection in page load. So, if the...
1
2566
by: Jay | last post by:
I'm wondering if anyone has even encountered a control or other scripting that will automatically rotate the rows of a datagrid... I am in the process of building an asp.net application that will display statistics on a large LCD display for viewing by people within the room (30 feet away). One problem is that the screen can obviously only display so much legible data at a time. I may have upwards of 60 or 70 rows to display on a rotating...
0
9856
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10914
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10597
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7834
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5684
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4071
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.