locked
can't Add property to Custom Grid view RRS feed

  • Question

  • User34755630 posted

     I Create A custom Gridview.

    I need to add som custom properties to this control, but when I add the property I get error in design view  (it works fine in website):

    'ds' could not be set on property 'CssClass_Main'

     this is my code: 

    1    namespace Onev_Controls
    2    {
    3        public partial class DataView : GridView
    4        {
    5    
    6            private string _CssClass_Main = "DataView_Main";
    7            public string CssClass_Main
    8            {
    9                get
    10               {
    11                   if (ViewState["DataView_CssClass_Main"] == null)
    12                   {
    13                       ViewState["DataView_CssClass_Main"] = _CssClass_Main;
    14                       return ViewState["DataView_CssClass_Main"].ToString();
    15                   }
    16                   return ViewState["DataView_CssClass_Main"].ToString();
    17               }
    18               set { ViewState["DataView_CssClass_Main"] = value; }
    19           }
    20        }
    21   }
    
             <Onev:DataView ID="DataViewID" runat="server"  CssClass_Main="ds">
    </Onev:DataView>
     

     

    Saturday, April 25, 2009 1:11 PM

Answers

  • User34755630 posted

     I am using vs2008.

    It's working now, I needed to shutdown the program and open it again.... strange stuff

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 27, 2009 5:47 PM

All replies

  • User-2106054853 posted

    Hi,

    It works fine on my side. What's your Visual Studio edition?

    Monday, April 27, 2009 3:58 AM
  • User34755630 posted

     I am using vs2008.

    It's working now, I needed to shutdown the program and open it again.... strange stuff

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 27, 2009 5:47 PM