sheetal

sheetal

  • NA
  • 22
  • 20.3k

How to make web user control readonly

Feb 20 2012 3:12 AM
Hi,

I have a web user control gridview containing table and rows and columns. I want to make it readonly based on certain conditions.
I have declared property in web user control page as follows:

 public Boolean ReadOnly
    {
        get
        {
            return ViewState["ReadOnly"] == null ? false : Convert.ToBoolean(ViewState["ReadOnly"]);
        }

        set
        {
            ViewState["ReadOnly"] = value;
        }
    }

Now I want to call this and set the control to readonly. How to do that?

Thanks,
Sheetal


Answers (1)