Click here to Skip to main content
15,888,816 members
Home / Discussions / C#
   

C#

 
GeneralSockets problem Pin
AnonymousTwo20-May-05 7:29
AnonymousTwo20-May-05 7:29 
GeneralRe: Sockets problem Pin
John Fisher20-May-05 9:11
John Fisher20-May-05 9:11 
GeneralRe: Sockets problem Pin
AnonymousTwo20-May-05 10:11
AnonymousTwo20-May-05 10:11 
GeneralRe: Sockets problem Pin
John Fisher20-May-05 10:55
John Fisher20-May-05 10:55 
GeneralRe: Sockets problem Pin
AnonymousTwo20-May-05 11:24
AnonymousTwo20-May-05 11:24 
GeneralRe: Sockets problem Pin
John Fisher20-May-05 19:19
John Fisher20-May-05 19:19 
Generalprob with activex Pin
amalatsliit20-May-05 7:10
amalatsliit20-May-05 7:10 
GeneralDataBinding Format/Parse Event, can't raise the Parse Event Pin
Kaneda7920-May-05 5:48
Kaneda7920-May-05 5:48 
Hello Everyone!

Well, as the header states, I don't get the Parse Event raised/fired.
This is my situation:
I have a DateTimePicker and a checkbox infront of it.

Parse Event:
If the checkbox is unchecked, the DataBinding is supposed to write null into the database (this means that the structural design wo which this date belongs hasn't been released).
Is the checkbox checked, the Value of the DateTimePicker is supposed to be written in the database.

FormatEvent:
If the field in the database contains a null value, the checkbox gets disabled (and so through another event the DateTimePicker).
Is there a date in the database, the checkbox gets enabled and marks the structural design as "released".

Well, the Format Event works fine, the Parse does nothing.
From the MSDN I understand that it gets raised under three conditions:
* after the Validated event of the Control object occurs.
* when the EndCurrentEdit method of the BindingManagerBase is called.
* when the Current object of the BindingManagerBase changes (in other words, when the Position changes).

I tried to force all of them, nothing happens.

Well here is my Code:

The Binding:


Binding bind = new Binding("Text", Ergo.MainApp._DesignDB._SelDesignDV, "Freigabe_Datum");<br />
bind.Parse  += new ConvertEventHandler(bind_Parse);<br />
bind.Format += new ConvertEventHandler(bind_Format);<br />
this.dTP_Freigabe.DataBindings.Add(bind);



The Events:


private void bind_Format(object sender, ConvertEventArgs e)<br />
{<br />
	if (e.Value == System.DBNull.Value)<br />
		this.chBx_Freigabe.Checked = false;<br />
	else<br />
		this.chBx_Freigabe.Checked = true;<br />
	}<br />
	<br />
private void bind_Parse(object sender, ConvertEventArgs e)<br />
{	<br />
		<br />
	MessageBox.Show("Holla");<br />
	if (!this.chBx_Freigabe.Checked )<br />
		e.Value = System.DBNull.Value;<br />
}


Here I get the Currency Manager:



myCM = (CurrencyManager)BindingContext[Ergo.MainApp._DesignDB._SelDesignDV];

Here I tried to call EndCurrendEdit():


BindingContext bc  = this.BindingContext;	<br />
bc[Ergo.MainApp._DesignDB._SelDesignDV].EndCurrentEdit();<br />
myCM.EndCurrentEdit();



and here is the DataBase Update:



public void UploadDataView(BindingContext bc)// <br />
{ <br />
        bc[selDesignDV].EndCurrentEdit(); <br />
        OleDbCommandBuilder cb = new OleDbCommandBuilder(designDA); <br />
        try <br />
        { <br />
                designDA.Update(designDS, "Zeichnungen"); <br />
        } <br />
        catch(Exception ex) <br />
        { <br />
                MessageBox.Show(ex.Message, "Fehler beim Upload der Daten - UploadDataView"); <br />
        } <br />
}

The DateTimePicker is bound to a DataView.
All other bindings in my form (without events) are working fine, so I guess the problem is just the raising of the Parse Event.

I even included a Validated Event, but that didn't do it either...

Every help is GREATLY appreciated, since this is the only thing that stops the first part of my program from beeing finished...
And did I mention that I have absolutly the opposite of much time?
QuestionHow to register Hotkey for TextBox? Pin
oohungoo20-May-05 5:47
oohungoo20-May-05 5:47 
AnswerRe: How to register Hotkey for TextBox? Pin
Marc Clifton20-May-05 6:35
mvaMarc Clifton20-May-05 6:35 
GeneralPicturebox and tiff file Pin
Anonymous20-May-05 4:43
Anonymous20-May-05 4:43 
GeneralRe: Picturebox and tiff file Pin
Robert Rohde20-May-05 6:04
Robert Rohde20-May-05 6:04 
GeneralNetwork Utlization Pin
Zishan Haider20-May-05 4:05
Zishan Haider20-May-05 4:05 
GeneralNice Class and Method Descriptions Pin
zandries20-May-05 3:56
zandries20-May-05 3:56 
GeneralRe: Nice Class and Method Descriptions Pin
Judah Gabriel Himango20-May-05 4:28
sponsorJudah Gabriel Himango20-May-05 4:28 
GeneralRe: Nice Class and Method Descriptions Pin
zandries20-May-05 4:40
zandries20-May-05 4:40 
GeneralRe: Nice Class and Method Descriptions Pin
Anonymous20-May-05 4:46
Anonymous20-May-05 4:46 
GeneralRe: Nice Class and Method Descriptions Pin
MoustafaS20-May-05 14:39
MoustafaS20-May-05 14:39 
GeneralLogPag Pin
albCode20-May-05 1:46
albCode20-May-05 1:46 
GeneralRe: LogPag Pin
MoustafaS20-May-05 1:59
MoustafaS20-May-05 1:59 
GeneralSimple Login Page Pin
albCode20-May-05 1:21
albCode20-May-05 1:21 
GeneralRe: Simple Login Page Pin
MoustafaS20-May-05 1:37
MoustafaS20-May-05 1:37 
GeneralI need to create one main datatable Pin
robmays20-May-05 0:22
robmays20-May-05 0:22 
GeneralRe: I need to create one main datatable Pin
MoustafaS20-May-05 1:38
MoustafaS20-May-05 1:38 
GeneralRe: I need to create one main datatable Pin
robmays23-May-05 1:18
robmays23-May-05 1:18 

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.