PC Review


Reply
Thread Tools Rate Thread

Data validation on row of DataGrid

 
 
lisa.biagioni@ct.gov
Guest
Posts: n/a
 
      6th Dec 2005
Hi,

I have a DataGrid bound to a DataTable in a Windows Forms application.
I'm using the DataTable.RowChanging event to trigger the validation of
a row when the user has modified a row and clicks off of it. The
problem is that there is no cancel on the RowChanging event. So, if
the validation on the row fails, how do you keep the pointer on the row
of the DataGrid where the error occurred?

Any help anyone could give me on this would be greatly appreciated!

Thanks in advance,

Lisa

 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      6th Dec 2005
Lisa - if you trap the CurrentCellChanged event
http://msdn.microsoft.com/library/de...angedtopic.asp
you can probably get what you need. You can also use Extended properties
for instance if your validation is simple to create a rule to validate
against. If I understand you correctly though, I think the
CurrentCellChanged event in conjunction with the specific column will get
you what you need.

HTH,

Bill
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a DataGrid bound to a DataTable in a Windows Forms application.
> I'm using the DataTable.RowChanging event to trigger the validation of
> a row when the user has modified a row and clicks off of it. The
> problem is that there is no cancel on the RowChanging event. So, if
> the validation on the row fails, how do you keep the pointer on the row
> of the DataGrid where the error occurred?
>
> Any help anyone could give me on this would be greatly appreciated!
>
> Thanks in advance,
>
> Lisa
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      7th Dec 2005
Lisa,

Have a look at this sample.

http://www.vb-tips.com/default.aspx?...d-203ca99d2825

I hope this helps,

Cor

<(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Hi,
>
> I have a DataGrid bound to a DataTable in a Windows Forms application.
> I'm using the DataTable.RowChanging event to trigger the validation of
> a row when the user has modified a row and clicks off of it. The
> problem is that there is no cancel on the RowChanging event. So, if
> the validation on the row fails, how do you keep the pointer on the row
> of the DataGrid where the error occurred?
>
> Any help anyone could give me on this would be greatly appreciated!
>
> Thanks in advance,
>
> Lisa
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom data validation on cells with data validation values AKrobbins Microsoft Excel Worksheet Functions 2 21st Jun 2011 04:20 PM
User Data Validation in a Datagrid. =?Utf-8?B?bWFyY21j?= Microsoft VB .NET 1 16th Jun 2006 03:36 PM
Custom Column Validation or DataGrid Cell Validation Stanislav Nedelchev Microsoft ADO .NET 0 15th Dec 2005 10:28 AM
When pasting data into a column with data validation I lose validation check Brad Microsoft Excel Misc 5 17th Apr 2004 01:11 PM
DataGrid Data Validation Question Ann Marinas Microsoft Dot NET Framework Forms 0 23rd Jan 2004 02:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:37 AM.