🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.pl.comp.lang.csharp
1 messages
1 total messages Started by Peter Zyczynski Thu, 29 Apr 2004 05:17
ChangeEventHandler nie responduje na pierwszy record
#1032
Author: Peter Zyczynski
Date: Thu, 29 Apr 2004 05:17
38 lines
1913 bytes
Witam,

Pszepraszam za muj tragiczny Polski, jestem z Australia.

Poczebuje pomoc z DataBinding i ChangeEventHandler.

Mam windows form project z dataset i textbox, databinding ustawilem w
programie, nie pszes IDE.  Uzywam ChangeEventHandler zeby zmusic textbox do
numerowej notacji "#,##0.0"

ChangeEventHandler nie reaguje na pierwszy record, ale nastempujonce dziala
ok.  Dziwne?  Dlaczego?


.... Databinding
private void DataBindControls()
{
  textBox1.DataBindings.Add("Text", this.myDataSet, "MYTABLE.MYCOLUMN");
  textBox1.DataBindings["Text"].Format += new
ConvertEventHandler(ToNumberString);
}

.... ConvertEventHandler
private void ToNumberString(object sender, ConvertEventArgs e)
{
  // Format number.
  if (e.Value.ToString() == string.Empty)
    e.Value = DBNull.Value;  // Don't format nulls.
  else
    e.Value = ((double)e.Value).ToString("#,##0.0#####");
}


Jeszce raz pszepraszam za muj Polski, powinenem byc wyslany do wienzienia za
blendy co tutaj napisalem.

Pozdrawiam,
Peter Zyczynski
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads