473,320 Members | 1,939 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,320 software developers and data experts.

Handle data error in datagridview.

Hello,
How can i force the cell to accept the input for now and flag it as error
for user to correct it later.

For Example:
case 1.
I have a column that is NOT bound to database table, then I can flag the
cell for error and move on to the next cell.
If isNumeric(DataGridView.CurrentCell.Value) = False Then
DataGridView.CurrentCell.ErrorText = "Invalid value, must be
number only"
End If
The cell will have an "!" mark on it with the error message attatched to
it.
case 2
Now, I am trying to do this with a column that bound to a database
table. And the value for this column in database is define as an Int. If I
try to enter in a non numeric value for the cell then it will call the
"dataError" event. When this happen, it will force me to stay at the current
cell until the error is fix.

Is there anyway that I can force the cell to accept the invalid value
and flag it with a "!" mark like above ?

I am sorry if I confuse you on this, and if you are, please let me know,
I'll try to explain again. Thanks
H

Nov 1 '07 #1
2 7627
Hyy,

You can use the errorstate of a datarow for that, then AFAIK will there be a
sign from the error provider. (I am not sure for the DataGridView however
that is the way in the DataGrid, I assume the same for the DataGridView).

Cor

Nov 2 '07 #2
Cor,
Thank you for getting back with me on it. However, I am not quite sure
what you mean on this. Could you please give me an example? code snippet
should be great. Thanks

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:90**********************************@microsof t.com...
Hyy,

You can use the errorstate of a datarow for that, then AFAIK will there be
a sign from the error provider. (I am not sure for the DataGridView
however that is the way in the DataGrid, I assume the same for the
DataGridView).

Cor
Nov 2 '07 #3

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

Similar topics

2
by: Ivan | last post by:
I have a class Foo which have two property. I have a thread that do some process and update class Foo int B. I have a datagridview on main form. this datagridview data source to this class Foo and...
2
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
4
by: Paul | last post by:
Hi, I have a project configured as follows: Main form with a tabcontrol with 1 tab page and a panel with some text boxes in. This form also has some bindingsources dropped onto the form. When...
9
by: trint | last post by:
How can I retrieve all of the data from a datagridview? Any help is appreciated. Thanks, Trint
6
by: =?Utf-8?B?TWFyY2Vsbw==?= | last post by:
Hello, I am new to pulling data into VB and using DataGridViews..... so this might be a dumb question but I can not seem to understand how to make this work. What I need acomplished: Exec a...
0
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by...
3
nirmalsingh
by: nirmalsingh | last post by:
hai all, i have added a dropdownlist control inside a datagridview by datagridview.controls.add method, now i want fire the event of dropdownlist, but when i try it, event of datagridview is firing....
1
by: Coderer | last post by:
I have a project that I've been working on for a while, where several forms use DataGridViews to represent database information. The forms are .NET 2.0, in Studio 2005. For the past couple of...
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...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.