Welcome Guest Search | Active Topics | Sign In | Register

Grid w/ CheckBoxColumn readonly Options
James
Posted: Friday, July 17, 2009 5:22:02 PM
Rank: Member
Groups: Member

Joined: 7/7/2009
Posts: 12
I set the ReadOnly property to True for the CheckBoxColumn...but it still allows you to check and uncheck it. Does that coincide with an html checkbox that can't be made readonly? I'm just trying to show a boolean value. I suppose I could use a text instead ('X').
eo_support
Posted: Friday, July 17, 2009 5:46:55 PM
Rank: Administration
Groups: Administration

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

CheckBoxColumn is mostly for editing. If you wish to display only, you can use a StaticColumn but set the columns' DataFormat to something like this:

Code: HTML/ASPX
<input type="checkbox" {0} disabled="disabled"/>


You would then do something like this in your SQL:

Code: SQL
SELECT IIF(checked, 'checked="checked"', '') AS checked_attr ....


The code assumes that you have a boolean (bit) field "checked" in your database. It creates a new field "checked_attr" in the result set with the value as either checked="checked" or blank. You can then set the StaticColumn's DataField to "checked_attr". At runtime the Grid would format this value with DataFormat and take the final output as grid cell content.

You can also use the same technique to display images in your cell.

Thanks!
David
Posted: Thursday, May 13, 2010 5:11:22 PM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
When I set the StaticColumn DataFormat property to what you suggest I get the following error:
Literal content ('<eo:StaticColumn DataField="CALL_SCREENING" DataFormat="<input type="checkbox" {0} disabled="disabled"/>" HeaderText="Call Screening" Width="120"> </eo:StaticColumn>') is not allowed within a 'EO.Web.GridColumnCollection'.

Please advise
eo_support
Posted: Thursday, May 13, 2010 5:23:45 PM
Rank: Administration
Groups: Administration

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

You can not have double quotes inside double quotes.

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.