Hide propety

Hide propety

Old forum URL: forums.lhotka.net/forums/t/942.aspx


ktweedy posted on Friday, August 18, 2006

Using a DataGrid with AutoGenerate columns is there an attribute I can put on a property to hide it so it isn't displayed?

I want to hide the IsValid properties, and stuff like that from the BusinessBase class.

ajj3085 replied on Friday, August 18, 2006

Hmm, Browsable( false ) should be doing that already, I think.

ktweedy replied on Friday, August 18, 2006

Thanks.  I tried this and it wasn't hidden in the DataGrid. 

[Browsable(true)]
public bool IsValid
{
   
get
   {
      
return base.IsValid;
   
}
}

This atribute is for the UI Design Mode as far as I have seen.

ktweedy replied on Friday, August 18, 2006

Seems it actually does work.  Might help if I set the flag to false. Geeked [8-|]

Here is what I ended up doing.

[Browsable(false)]

public override bool IsValid
{

get

{

return base.IsValid;

}

}

[Browsable(false)]

public override bool IsNew

{

get

{

return base.IsNew;

}

}

[Browsable(false)]

public override bool IsDeleted

{

get

{

return base.IsDeleted;

}

}

[Browsable(false)]

public override bool IsChild

{

get

{

return base.IsChild;

}

}

[Browsable(false)]

public override bool IsSavable

{

get

{

return base.IsSavable;

}

}

 

Copyright (c) Marimer LLC