Welcome Guest Search | Active Topics | Sign In | Register

Can the GRID columns be formatted and/or hidden at run time ? Options
MannyRosa
Posted: Tuesday, September 6, 2011 9:03:33 AM
Rank: Member
Groups: Member

Joined: 9/6/2011
Posts: 26
I have the need to hide / show some columns in the GRID depending on the data selected for the GRID, can I dynamically change properties of the grid. For example I want to hide the SSN for some users and show it for other users of the site.
eo_support
Posted: Tuesday, September 6, 2011 12:02:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. You can do that. You can either just make sure you clear out the text on the server side, or use CSS to hide the cell text.

To clear out the text, you can set the GridCell's Value to null. You can either do this on the server side after data binding, or do it on the client side by calling this function:

http://doc.essentialobjects.com/library/1/jsdoc.public.gridcell.setvalue.aspx

To do it through CSS style, you would apply "display:none" or "color: same_fore_color_as_your_background_color" in your cell style. The Grid provide two ways for you to apply different styles for different cells:

1. Conditional formating based on your data source. See here for a working example:

http://demo.essentialobjects.com/Demos/Grid/Features/Conditional%20Formatting%20-%20Cell%20Based/Demo.aspx

2. Explicitly overriding cell style:

http://doc.essentialobjects.com/library/1/jsdoc.public.gridcell.overridestyle.aspx

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.