1
Reply

How to make web user control readonly

Ask a question
sheetal

sheetal

12y
2.5k
1
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)