|
-
Apr 22nd, 2007, 05:34 PM
#1
Thread Starter
Addicted Member
[2005] Data grid errors
Hi,
I have a series of data grids in my project.
Some of the fields in the grids are date and numbers. I don't believe i have assigned these columns as these types so can someone tell me whether the are automatically assigned from the database.
the validation here is all well and good. However when the user enters an incorrect value, it produces a very large unfriendly message relating the error.
I can't seem the find where this error message comes from in my code to change it. Can anyone help?
-
Apr 22nd, 2007, 05:51 PM
#2
Re: [2005] Data grid errors
I see that you're using VB 2005. Do you really have a series of DataGrids or do you actually have a series of DataGridViews? The two are quite different so please be clear when posting. If you are using DataGrids then I would question why, because the DataGridView is superior in almost every way. Also, if you are using a DataGridView then that large, unfriendly message tells you what to do to avoid it and provide your own error message.
-
Apr 22nd, 2007, 06:03 PM
#3
Thread Starter
Addicted Member
Re: [2005] Datagridview errors
i see it says to handle the data error event, but i don't know how to do this or where to place it in my code
-
Apr 22nd, 2007, 06:09 PM
#4
Re: [2005] Data grid errors
It's just an event like any other, so you would create the event handler the same way you do any other event handler and you would put in the same place you do any other event handler. To create a handler for an event that is not the default you either use the Properties window and press the Events button or you use the drop-down lists at the top of the code window.
Once you have the empty method definition you simply add the code to do what you want. Like any event handler the 'e' parameter contains the data for the event. You should read the documentation for the DataGridView.DataError event and see what data that object provides and then decide how best to use it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|