Click here to Skip to main content
15,921,837 members
Home / Discussions / C#
   

C#

 
QuestionCalling Events from dll to html using javascript Pin
HASEENAA16-Nov-06 1:07
HASEENAA16-Nov-06 1:07 
QuestionReading text file from Resources Pin
Muntyness16-Nov-06 1:07
Muntyness16-Nov-06 1:07 
AnswerRe: Reading text file from Resources Pin
JoeSharp16-Nov-06 1:24
JoeSharp16-Nov-06 1:24 
GeneralRe: Reading text file from Resources Pin
Muntyness16-Nov-06 1:55
Muntyness16-Nov-06 1:55 
GeneralRe: Reading text file from Resources Pin
JoeSharp16-Nov-06 2:01
JoeSharp16-Nov-06 2:01 
GeneralRe: Reading text file from Resources Pin
Muntyness16-Nov-06 2:28
Muntyness16-Nov-06 2:28 
GeneralRe: Reading text file from Resources [modified] Pin
Muntyness17-Nov-06 6:27
Muntyness17-Nov-06 6:27 
QuestionCatching the Exception thrown from a property that change throu DataBinding [modified] Pin
NassosReyzidis16-Nov-06 0:40
NassosReyzidis16-Nov-06 0:40 
Hello All,
i have a property in my DataClass and i bound it to a control
<br />
Binding adminBind = new Binding("Checked", user, "IsAdministrator");<br />
this.chkIsAdmin.DataBindings.Add(adminBind);<br />

this Property throw an Exception when some conditions not meet (this code is inside the set of the Property).
<br />
public bool IsAdministrator<br />
		{<br />
			get { return Convert.ToBoolean(_Record.WL_ISADMIN.Value); }<br />
			set<br />
			{<br />
				//If the New value is true<br />
				if (value)<br />
				{<br />
					if (CanBeTheUserAdmin())//Check if the Garage Has Admin User<br />
					{<br />
						//No Admin User, This Becomes Admin<br />
						_Record.WL_ISADMIN.Value = value;<br />
					}<br />
					else//If the Garage Has Admin User throw Exception<br />
						throw new Exception("Δεν Μπορείτε να κάνετε τον Χρήστη Administrator διότι Υπαρχει ήδη Administrator για το Συνεργείο!!");<br />
				}else//If the New value is False, applying it to the user<br />
					_Record.WL_ISADMIN.Value = value;<br />
			}<br />
		}<br />

right now when the exception is thrown the control just DON'T lose Focus, and the user get confused.

How can i cath the Exception in order to show the Exception Message to the User??
Any Saggestion is most Wellcome!
Nassos


-- modified at 7:41 Thursday 16th November, 2006

GanDad

QuestionWhy do we have properties? Pin
Russell Jones15-Nov-06 23:26
Russell Jones15-Nov-06 23:26 
AnswerRe: Why do we have properties? Pin
Martin#15-Nov-06 23:35
Martin#15-Nov-06 23:35 
GeneralRe: Why do we have properties? Pin
Russell Jones16-Nov-06 0:09
Russell Jones16-Nov-06 0:09 
AnswerRe: Why do we have properties? Pin
J4amieC15-Nov-06 23:55
J4amieC15-Nov-06 23:55 
AnswerRe: Why do we have properties? Pin
Martin2316-Nov-06 0:00
Martin2316-Nov-06 0:00 
AnswerRe: Why do we have properties? Pin
V.16-Nov-06 2:34
professionalV.16-Nov-06 2:34 
QuestioniPod like menu for pocket pc development Pin
HRiazi15-Nov-06 23:07
HRiazi15-Nov-06 23:07 
QuestionProblem in building DirectShow Application Pin
alpa shah15-Nov-06 22:06
alpa shah15-Nov-06 22:06 
AnswerRe: Problem in building DirectShow Application Pin
AB777115-Nov-06 22:33
AB777115-Nov-06 22:33 
GeneralRe: Problem in building DirectShow Application Pin
alpa shah15-Nov-06 22:46
alpa shah15-Nov-06 22:46 
GeneralRe: Problem in building DirectShow Application Pin
Amar Chaudhary15-Nov-06 23:01
Amar Chaudhary15-Nov-06 23:01 
GeneralRe: Problem in building DirectShow Application Pin
AB777115-Nov-06 23:01
AB777115-Nov-06 23:01 
GeneralRe: Problem in building DirectShow Application Pin
alpa shah15-Nov-06 23:07
alpa shah15-Nov-06 23:07 
GeneralRe: Problem in building DirectShow Application Pin
AB777115-Nov-06 23:33
AB777115-Nov-06 23:33 
GeneralRe: Problem in building DirectShow Application Pin
alpa shah15-Nov-06 23:43
alpa shah15-Nov-06 23:43 
GeneralRe: Problem in building DirectShow Application Pin
AB777115-Nov-06 23:55
AB777115-Nov-06 23:55 
GeneralRe: Problem in building DirectShow Application Pin
alpa shah16-Nov-06 0:02
alpa shah16-Nov-06 0:02 

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.