Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig Cronin 304 posts 503 karma points
    Apr 12, 2013 @ 14:15
    Craig Cronin
    0

    Data Grid adding multiple item issues.

    HI,

    I have an umbraco 6.0.3 install using uComponents 5.4.1.

    I have setup a data grid data type that has two columns "Activities" which is a textbox and "Time" which is also a textbox.

    It won't let me add multiple items unless i save the document on each item.  If i add a second item without saving i can see the first item disappear.

     

    Any help would be appreciated :)

  • Berto 105 posts 177 karma points
    May 08, 2013 @ 16:37
    Berto
    0

    Same problem here.

    Any sugestions?

  • Berto 105 posts 177 karma points
    May 08, 2013 @ 17:33
    Berto
    0

    Got it:

    The method  CreateChildControls on DTG_DataEditor.cs of uComponents.DataTypes is not checking is the ViewState has values.

    Just put this

     if (!string.IsNullOrEmpty(this.DataString))
     {
     this.data.Value = this.DataString;
     }

    Before this

    if (this.data.Value == null)
    
  • Berto 105 posts 177 karma points
    May 08, 2013 @ 18:51
    Berto
    0

    Regarding this problem, just made a pull request to uComponents:

    https://ucomponents.codeplex.com/SourceControl/network/forks/TheKahuna/uComponents/contribution/4671

  • Craig Cronin 304 posts 503 karma points
    May 08, 2013 @ 19:03
    Craig Cronin
    0

    Hi Berto,

    Brilliant news, i'm sure Lee Kelleher would appreciate this :)  Sorry I didnt have a change to pull the code and look at it really.

  • Craig Cronin 304 posts 503 karma points
    May 08, 2013 @ 19:47
    Craig Cronin
    0

    looking at the code now it looks like  this.data.Value = this.DataString;

    was missed from the if else condition.

    if (this.data.Value == null)

                {

                    DtgHelpers.AddLogEntry(string.Format("DTG: No values exist in database for this property"));

     

                    this.data.Value = string.Empty;

                }

                else

                {

                    DtgHelpers.AddLogEntry(

                        string.Format("DTG: Retrieved the following data from database: {0}", this.data.Value));

     

                    this.data.Value = this.DataString;

                }

  • Berto 105 posts 177 karma points
    May 09, 2013 @ 12:10
    Berto
    0

    Hi Craig, 

    that code is not necessary on the else case, beacause it's already set with the values from the database (data.Value != null)

  • Craig Cronin 304 posts 503 karma points
    May 09, 2013 @ 17:43
    Craig Cronin
    0

    thanks berto

Please Sign in or register to post replies

Write your reply to:

Draft