473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inserting rows into datagrids

I have 2 methods activated through a context menu that insert and delete rows
from the dataTable linked to a datagrid.

I can delete rows the selected row with no problems, but when I try to use
the insertat method of the dataTable class the row is inserted at the bottom
of the datagrid. I read that it is still inserted into the datatable at the
right spot. is there a way to make it so the datagrid also displays the
correct location of the new row without shifting all the data? Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

Mar 7 '07 #1
2 1195
YA We can ..In the Item Bound of the Grid BEfore Adding new row add the Grid
Content to the Dataset ..Then at any instance u can find the the Number of
rows ..Now add a new Blank row the Dataset and Bind it to Grid . Now u will
have a Blank row at the Bottom of the Grid.
"J Streger" wrote:
I have 2 methods activated through a context menu that insert and delete rows
from the dataTable linked to a datagrid.

I can delete rows the selected row with no problems, but when I try to use
the insertat method of the dataTable class the row is inserted at the bottom
of the datagrid. I read that it is still inserted into the datatable at the
right spot. is there a way to make it so the datagrid also displays the
correct location of the new row without shifting all the data? Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003
Mar 8 '07 #2
I'm sorry if I wasn't clear, but I'm trying to insert a row inbetween 2
existing rows in a datagrid without me having to manually shift all the data
down to make the empty row.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

"Prabakar Samiyappan" wrote:
YA We can ..In the Item Bound of the Grid BEfore Adding new row add the Grid
Content to the Dataset ..Then at any instance u can find the the Number of
rows ..Now add a new Blank row the Dataset and Bind it to Grid . Now u will
have a Blank row at the Bottom of the Grid.
"J Streger" wrote:
I have 2 methods activated through a context menu that insert and delete rows
from the dataTable linked to a datagrid.

I can delete rows the selected row with no problems, but when I try to use
the insertat method of the dataTable class the row is inserted at the bottom
of the datagrid. I read that it is still inserted into the datatable at the
right spot. is there a way to make it so the datagrid also displays the
correct location of the new row without shifting all the data? Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003
Mar 8 '07 #3

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

Similar topics

1
by: Srinadh | last post by:
Hi all, We have files with about 20 to 30 fields per row. We are trying to update such files with about 60 rows as contiguous data in a CLOB field. It passes through. But when we try...
3
by: Joachim Klassen | last post by:
Hi all, first apologies if this question looks the same as another one I recently posted - its a different thing but for the same szenario:-). We are having performance problems when...
2
by: a | last post by:
NEW Post Here's my best guess at how to insert this dataset.... the code runs, but no new records are added to the sql table. I've read and split a delimited text file into a dataset. It...
7
by: GaryB | last post by:
I have an untyped datatable that has financial numbers and controls that were populated by code (not a simple fill from a DA). Now I want to insert subtotals into it. I wrote a sub to do so that...
0
by: Flack | last post by:
I have pasted at the end of this message a small sample program I whipped up to do some testing. It's a form with a datagrid and two buttons. Each button clears the dataTable that is the source...
3
by: rcoco | last post by:
Hi, I want to share this problem. I have a datagrid that will help me Insert data into sql database. So I made a button On my form so that when I press the button a new row on datagrid should be...
2
by: Blasting Cap | last post by:
I've got a gridview (that I converted over from a datagrid, which had been working properly), that is doubling up the number of rows returned. When it was running as a datagrid, the same code sent...
0
by: toyin | last post by:
hello, pls help look through this code its not inserting the record in dataset into the another database. i want to insert the row in the dataset into another table in another database. pls help....
1
by: evenlater | last post by:
I have an Excel workbook that I'm programming from Access. The rows in the workbook vary in height. So let's say row 8 is taller than the rows above it. If I *manually* insert 2 new rows at the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.