Property Greyed Out in VS

J

jcteague

I have a Server Control that inherits from DataGrid. I've added an
object type property called DataMethodParameter, but this property is
greyed out in the properties list in Visual Studio.

private object dataMethodParameter = null;

[Category("Data"),
Description("Parameter to Pass to the selected OrdersProvider Method")]
public object DataMethodParameter
{
get{return this.dataMethodParameter;}
set{this.dataMethodParameter = value;}
}

Any suggestions?
 
B

Brock Allen

The datatype is object. If it were int or string then VS.NET would be able
to parse it and know what to expect.
 
J

jcteague

Well, that poses a problem. The datatype could be practically
anything. I am casting it in the code based on other parameters. Any
suggestions on how I could do this other than making it a string and
using Convert. That could pose some problems as well.
 
B

Brock Allen

What is it supposed to represent? If it can be almost anything, then wouldn't
that mean it'd have to be set at runtime? I mean, anything could be an Int32,
a System.Drawing.Color, or a System.Xml.XmlDocument, right?
 
J

jcteague

Yes and No.
This is a CodeSmith template to work with the NetTiers project. I am
generating Custom DataGrids for their providers. Based on which
provider method the choose I can cast appropriately. They have a
built-in method for getting the right type. I think this just means I
have a little more work.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top