SubSonic Forums
All Your Database Are Belong To Us

Does anyone else need to initially sort the Gridview portion of a Scaffold??

Latest post 06-16-2008 1:03 AM by yitzchok. 3 replies.
  • 06-12-2008 4:24 AM

    • dhigginx
    • Top 500 Contributor
    • Joined on 02-06-2008
    • California
    • Posts 10

    Does anyone else need to initially sort the Gridview portion of a Scaffold??

    I dont know if this might be something added to the eventual release but all that is needed to add initial sorting based on a single column is to add the following property to the Scaffold class.  One can then set the property at Design time and affect the initial sort. Note: This will also allow you another way to check the sort column of the Gridview at run time.

    /// <summary>
    /// Lets you select the Column that you want to sort the grid portion of the scaffold upon
    /// </summary>
    /// <value>
    ///  <c>PKID</c>
    /// </value>
    [Bindable(true)]
    [Category("Data")]
    [Description("The Column that you want to sort the grid portion of the scaffold upon.")]
    [DefaultValue("")]
    public string GridOrderBy
    {
        get
        {
            if (ViewState[ORDER_BY] == null)
            {
                ViewState[ORDER_BY] = String.Empty;
            }
            return ViewState[ORDER_BY].ToString();
        }
        set { ViewState[ORDER_BY] = value; }
    }

     

  • 06-12-2008 11:02 PM In reply to

    Re: Does anyone else need to initially sort the Gridview portion of a Scaffold??

    You can post a patch on codeplex.

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 06-13-2008 3:31 AM In reply to

    • dhigginx
    • Top 500 Contributor
    • Joined on 02-06-2008
    • California
    • Posts 10

    Re: Does anyone else need to initially sort the Gridview portion of a Scaffold??

    I've not done this before, what is the process and format?

     

  • 06-16-2008 1:03 AM In reply to

    Re: Does anyone else need to initially sort the Gridview portion of a Scaffold??

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

Page 1 of 1 (4 items) | RSS