http://bugzilla.novell.com/show_bug.cgi?id=595568
http://bugzilla.novell.com/show_bug.cgi?id=595568#c0 Summary: DataControlField databinding consistency issue between Mono and MS.NET Classification: Mono Product: Mono: Class Libraries Version: 2.6.x Platform: x86-64 OS/Version: Windows 7 Status: NEW Severity: Normal Priority: P5 - None Component: Sys.Web AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Created an attachment (id=353603) --> (http://bugzilla.novell.com/attachment.cgi?id=353603) Testcase which adds custom field to the GridView and fails on Mono. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.360.0 Safari/533.3 Some DataControlFields, such as CheckBoxField and ImageField, have two protected virtual methods: InitializeDataCell() and OnDataBindField(). Overriding only InitializeDataCell() leads to consistency issues, because in some cases, such as CheckBoxField and ImageField (but not BoundField), Mono expects the source of the DataBinding event to be the cell, and not the child control of the cell. So overriding just the InitializeDataCell() for code reuse works in .NET, but results in InvalidCastException in Mono. Original discussion can be found at http://forum.gaiaware.net/yaf_postsm1935_GridView-and-Mono.aspx . Reproducible: Always Steps to Reproduce: 1. Add GridView to Page markup. 2. Set AutoGenerateColumns property to False. 3. Create a derived class from CheckBoxField. 4. Override InitializeDataCell(). 5. Create a CheckBox in InitializeDataCell(). 6. Add newly created CheckBox the Controls collection of the cell. 7. Attach OnDataBinding() event handler to the newly created CheckBox. 8. During OnInit() event of the GridView create instance of the custom field. 9. Add custom field to the Columns collection of the GridView. 10. During Page_Load DataBind the GridView. Actual Results: Following exception occurs: System.InvalidCastException: Cannot cast from source type to destination type. at System.Web.UI.WebControls.CheckBoxField.OnDataBindField (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 Expected Results: Expected the same behavior as with MS.NET: rendering of the CheckBoxes created by the custom field. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
