Click here to Skip to main content
15,905,867 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: regex name/value pairs Pin
Keith Malwitz5-Jan-07 17:55
Keith Malwitz5-Jan-07 17:55 
AnswerRe: regex name/value pairs Pin
Mike Dimmick5-Jan-07 6:27
Mike Dimmick5-Jan-07 6:27 
Questionnon-selectable item in treeview Pin
Russell Jones4-Jan-07 4:18
Russell Jones4-Jan-07 4:18 
QuestionDrawString and text wrapping Pin
Ray Cassick4-Jan-07 3:14
Ray Cassick4-Jan-07 3:14 
AnswerRe: DrawString and text wrapping Pin
Luc Pattyn4-Jan-07 9:05
sitebuilderLuc Pattyn4-Jan-07 9:05 
GeneralRe: DrawString and text wrapping Pin
Ray Cassick4-Jan-07 9:50
Ray Cassick4-Jan-07 9:50 
QuestionProperty paths in .NET 3.0 / WPF Pin
FalkoD3-Jan-07 7:20
FalkoD3-Jan-07 7:20 
QuestionData source updated even if e.Cancel = true in Validating handler Pin
roel_v3-Jan-07 6:59
roel_v3-Jan-07 6:59 
Hi everyone,

I have a textbox on a form with a Validating event handler attached. The textbox is bound to a data source. The code for the event handler is given below. Basically, the amount entered in the text field should not exceed the amount in the balance field. If this happens, error provider is set and Validating event is cancelled, giving the user the opportunity to correct the amount.

On the UI side e'thing is working fine, however I noticed that the data source is updated regardless, even if e.Cancel is set to true. That is a problem because the data source should never be set to an invalid value as it is taken as input for other calculations.

I expected that the data source would not be updated if e.Cancel is set to 'true'. Am I missing something?

Thanks,

Roel

private void textBoxCash_Validating(object sender, CancelEventArgs e)
{
if (Convert.ToDouble(textBoxCash.Text) > this.balance)
{
errorProvider.SetError(textBoxGenerateCash, "Cash exceeds balance");
e.Cancel = true;
}
else
{
errorProvider.SetError(textBoxCash, null);
}
}

Questionopengl csgl taoframwork or direct3d [modified] Pin
Taylor Kobani3-Jan-07 5:34
Taylor Kobani3-Jan-07 5:34 
Question"Full Screen printing" Pin
Silver-Grey3-Jan-07 3:44
Silver-Grey3-Jan-07 3:44 
AnswerRe: "Full Screen printing" Pin
Ray Cassick4-Jan-07 3:15
Ray Cassick4-Jan-07 3:15 
QuestionCan I get any .net developpped library with proper UI Pin
indian1432-Jan-07 18:40
indian1432-Jan-07 18:40 
AnswerRe: Can I get any .net developpped library with proper UI Pin
Christian Graus2-Jan-07 23:35
protectorChristian Graus2-Jan-07 23:35 
GeneralRe: Can I get any .net developpped library with proper UI Pin
indian1433-Jan-07 2:19
indian1433-Jan-07 2:19 
GeneralRe: Can I get any .net developpped library with proper UI Pin
Christian Graus3-Jan-07 8:52
protectorChristian Graus3-Jan-07 8:52 
GeneralRe: Can I get any .net developpped library with proper UI Pin
Pete O'Hanlon3-Jan-07 9:07
mvePete O'Hanlon3-Jan-07 9:07 
GeneralRe: Can I get any .net developpped library with proper UI Pin
indian1433-Jan-07 18:22
indian1433-Jan-07 18:22 
QuestionAdding Own Buttons To Title Bar Pin
Nagaraju_Focus2-Jan-07 17:59
Nagaraju_Focus2-Jan-07 17:59 
AnswerRe: Adding Own Buttons To Title Bar Pin
Robert Rohde3-Jan-07 1:11
Robert Rohde3-Jan-07 1:11 
QuestionPortable .Net Framework Pin
joejoeiscool2-Jan-07 4:48
joejoeiscool2-Jan-07 4:48 
AnswerRe: Portable .Net Framework Pin
Dave Kreskowiak2-Jan-07 5:46
mveDave Kreskowiak2-Jan-07 5:46 
AnswerRe: Portable .Net Framework Pin
Christian Graus2-Jan-07 23:37
protectorChristian Graus2-Jan-07 23:37 
GeneralRe: Portable .Net Framework Pin
Dave Kreskowiak3-Jan-07 3:29
mveDave Kreskowiak3-Jan-07 3:29 
GeneralRe: Portable .Net Framework Pin
joejoeiscool3-Jan-07 7:04
joejoeiscool3-Jan-07 7:04 
GeneralRe: Portable .Net Framework Pin
Dave Kreskowiak3-Jan-07 7:17
mveDave Kreskowiak3-Jan-07 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.