[Mono-bugs] [Bug 623406] New: ConvertEmptyString doesn't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 19 06:51:45 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=623406

http://bugzilla.novell.com/show_bug.cgi?id=623406#c0


           Summary: ConvertEmptyString doesn't work
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: i586
        OS/Version: openSUSE 11.3
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: yuditriwibowo at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User
           Blocker: ---


Description of Problem:

I used databounds column in an editable and deletable Gridview. Both  default
without setting ConvertEmptyStringToNull and by setting Explicitly
ConvertEmptyStringToNull="true". They don't work.

It always produce error when trying to update  Empty TextBoxes. 

I can proof that the conversion doesn't work by using work around of my
project. My work around is adding code below in RowUpdating event :

protected void GridViewProducts_RowUpdating(object sender,
GridViewUpdateEventArgs e)
        {
            //For Compatibility with Mono, Mono ignores
ConvertEmptyStringToNull, so Convert them manually
            int numberOfParam = e.NewValues.Count;

            for (int i = 0; i < numberOfParam; i++)
            {

                if (e.NewValues[i] == "")
                    e.NewValues[i] = null;

                if (e.OldValues[i] == "")
                    e.OldValues[i] = null;


            }
        }

Above code works well.

But When I tried to apply the same way to deleting event it doesn't work. (I'm
trying to implement optimistic concurency, by expecting the original values of
each fields).

My code below doesn't work :

protected void GridViewProducts_RowDeleting(object sender,
GridViewDeleteEventArgs e)
        {
            //For Compatibility with Mono, Mono ignores
ConvertEmptyStringToNull, so Convert them manually

            //It doesn't work !! somehow e.Values[i] cannot be set to null
            //int numberOfParam = e.Values.Count;

            //for (int i = 0; i < numberOfParam; i++)
            //{
            //    if (e.Values[i] == "")
            //        e.Values[i] = null;               
            //}


        } 





Actual Results:
Empty String

Expected Results:
Null

How often does this happen? 
Always

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list