473,785 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid, AllowNew, pasting inserts rows

Hi All,

I have a DataGrid that is a visual representation of a DataSet. It was
created like so:
dataset = new DataSet();
adapter.Fill(da taset);
dataGridTable.D ataSource = dataset.Tables[0];
dataGridTable.T ableStyles.Clea r();
DataGridTableSt yle tableStyle = new DataGridTableSt yle();
dataGridTable.T ableStyles.Add( tableStyle);

I'd like to prevent users from adding new rows, while still allowing
them to edit table data. So, I did:
dataset.Tables[0].DefaultView.Al lowNew = false;
dataset.Tables[0].DefaultView.Al lowEdit = true;

OK, I no longer see that last row of the DataGrid with the "*" on it,
so it _looks_ like I've been prevented from inserting new rows, but
there is a problem.
Try:
Select and copy two rows
Select two other rows and paste over them

Expect to see:
Copied information pasted over the selected rows.

But See:
The two rows you were trying to paste appear as newly inserted rows.

Can anyone tell me what's going on and how to fix it? Am I missing
something basic?

Thanks much,
whitecrow

Jan 9 '06 #1
1 1715
Hmm, I've kept on playing with this. It really looks like a bug in the
language, but I'm just a beginner -- it's extremely unlikely that I've
actually found a language bug. Still can't solve it, though.

Jan 10 '06 #2

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

Similar topics

4
592
by: Joy | last post by:
Hi, I need to be able to to disable the Apend Row feature of the VB.NET datagrid and then enable it again. The reason is because I want to allow a user to enter as many rows in the datagrid as they want until a certain number of rows is reached. When that number of rows is reached I want to disable the Apend Row feature - BUT if they delete a row, I want to enable the Apend Row feature again. Does that make sense?? I have code that...
2
9927
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell (multi-select without modifier keys). I got that working fine, but I also wanted to keep rows selected after a sort, which I do by storing the row's id in an arraylist. The idea was to do the sort and then go back and re-select the rows with that...
4
2285
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a combobox in a datagrid? Any other suggestions/articles on how to implement many-many relations in the frontend (which of course are 2 one-many relations)?
4
2095
by: Joy | last post by:
Hi, I need to be able to to disable the Apend Row feature of the VB.NET datagrid and then enable it again. The reason is because I want to allow a user to enter as many rows in the datagrid as they want until a certain number of rows is reached. When that number of rows is reached I want to disable the Apend Row feature - BUT if they delete a row, I want to enable the Apend Row feature again. Does that make sense?? I have code that...
0
9646
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
10346
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...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7504
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
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
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.