473,327 Members | 2,065 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,327 software developers and data experts.

Problem with new Row on DataGridView

Hi, I have a DataGridView on a form and it is bound to a
BindingSource. Some fields are necessary and so cannot accept Null
values. My problem is that when I run the program and try to add a new
row to the DataGridView and value of one of the necessary cells is
missing, when I click anywhere on the form it throws an exception and
prompts that that cell cannot be empty and it cancels the newly added
row. What I want to do is just prompt the user to add the value for
the cell and not canceling the new row. Can anyone please help?

Oct 31 '07 #1
1 1268
Hi,
check this link :

http://www.codeproject.com/aspnet/DataGridInsert.asp
Cheers,
Husam Al-A'araj
www.aaraj.net

"shahoo" wrote:
Hi, I have a DataGridView on a form and it is bound to a
BindingSource. Some fields are necessary and so cannot accept Null
values. My problem is that when I run the program and try to add a new
row to the DataGridView and value of one of the necessary cells is
missing, when I click anywhere on the form it throws an exception and
prompts that that cell cannot be empty and it cancels the newly added
row. What I want to do is just prompt the user to add the value for
the cell and not canceling the new row. Can anyone please help?

Nov 1 '07 #2

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

Similar topics

0
by: Pieter Coucke | last post by:
Hi, I have a DataGridView, that contains a list of Articles, which can be added (automaticly via the AllowUserToAddRows) and changed by the user. The current item is also displayed in textboxes...
1
by: sapkal.manish | last post by:
Question : How can I find actual row position of DataTable in DataGridView when DataTable is sorted / My source code like this Private WithEvent dgvInwDet as new DataGridView Private...
1
by: Rich | last post by:
Hello, I am reading data from a sql server table that is under replication. This table has the replicatin GUID column that is generated with replicatin. I am reading the data from a...
6
by: George | last post by:
Hi, I have been encountering a refresh problem with DataGridView, which is bound to a DataTable. When I make updates (Add, Delete, update) to the DataGridView, everything flow nicely to...
4
by: shibeta | last post by:
Hello, I have problem with DataGridView and BindingSource. I have created DataSet and added TableData to it with manualy created columns (without DataAdapter - I'm not using MSSQL). On the Form I...
1
by: Ahmed Yasser | last post by:
Hi all, i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps: 1. i have a datagridview with two columns...
1
by: Jeff | last post by:
Hey ..NET 2.0 I've created a User Control which contain a DataGridView. This User Control is displayed on a TabPage. This TabPage is added to the TabControl during runtime. The problem is...
0
by: mianghous | last post by:
hi I have a little problem i m using a datagridview on ma aspx page and problem is that its size does not remain same... mean if i fecth 10 records it will show 10 and size will expand of the...
3
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows...
0
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.