[Mono-bugs] [Bug 347530] New: Binding: set_FormattingEnabled method not found
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Dec 11 06:34:01 EST 2007
https://bugzilla.novell.com/show_bug.cgi?id=347530
Summary: Binding: set_FormattingEnabled method not found
Product: Mono: Class Libraries
Version: 1.2.6
Platform: Other
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Windows.Forms
AssignedTo: mono-bugs at ximian.com
ReportedBy: kobruleht2 at hot.ee
QAContact: mono-bugs at ximian.com
Found By: ---
To reproduce, run code.
Observed: method not found: Binding.set_FormattingEnabled
using System;
using System.Windows.Forms;
class Test {
static void Main() {
try {
Application.Run(new Form1());
} catch (Exception ex) {
MessageBox.Show(ex.ToString());
}
}
}
class Form1 : Form {
public Form1() {
NullableDateTimePicker dtp = new NullableDateTimePicker();
Customer c = new Customer();
Binding b = new Binding("Value", c, "Date");
b.FormattingEnabled = true;
dtp.DataBindings.Add(b);
Controls.Add(dtp);
}
}
class Customer {
public DateTime? Date { get; set; }
}
class NullableDateTimePicker : DateTimePicker {
public NullableDateTimePicker()
: base() {
Format = DateTimePickerFormat.Short;
ShowCheckBox = true;
}
public new DateTime? Value {
get {
if (!this.Checked)
return null;
return base.Value;
}
set {
if (value != null) {
base.Value = (DateTime)value;
Checked = true;
} else {
Checked = false;
}
}
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list