Hi,
There is no way to directly disable an item in the Grid. However you can code to make it "looks" disabled. This includes:
1. Assign a different StyleSetID to those GridItems so that they visually look different. See here for more information about how to customize styles:
http://doc.essentialobjects.com/library/1/grid/styling.aspxIf you populate it from database, you can set the Grid's StyleSetIDField:
http://doc.essentialobjects.com/library/1/eo.web.grid.stylesetidfield.aspx2. Add an additional GridColumn and set this column's Visible to false. You will use this field to store values indicating whether the GridItem is enabled;
3. If you allow edit on the Grid, handle the Grid's ClientSideBeforeEditItem (when FullRowMode is set to true) or the Grid columns' ClientSideBeforeEdit event and return false from your handler to disable editing. It will be something like this:
Code: HTML/ASPX
<eo:Grid ClientSideBeforeEditItem="before_edit_handler" ....>
....
</eo:Grid>
Code: JavaScript
function before_edit_handler(gridItem, save)
{
//This code assumes the first column is the hidden
//column that stores value indicating whether the
//item should be disabled. Also it assumes value "1"
//means the item is disabled
if (gridItem.getCell(0).getValue() == "1")
return false;
}
3. If you use ContextMenu, change your code to check whether the item is disabled. For example:
Code: JavaScript
function ShowContextMenu(e, grid, item, cell)
{
//Return directly if the item is disabled.
//NOTE: THE CODE RETURN true HERE. THIS IS
//NOT A TYPO. If you return false the default
//browser context menu will be shown
if (item.getCell(0).getValue() == "1")
return true;
....code to show context menu
}
Hope this helps.
Thanks!