I'm trying to hide a column (via a css class with only "display:none" in it), that is working more or less (the remaining visible columns are a bit shifted to the right somehow). But when I enable the activation behaviour, I receive this Javascript error: "htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus".
Is there any way to be able to use hidden columns and activation without Javascript errors?
Pieter:
While you cannot use CSS to create hidden columns when using activation, there is a way around this issue. I recently did a post demonstrating how to implement an Ajax master/detail page where I hid the primary key data in a hidden SPAN rather than making the column hidden. You can check out the code and explanation here:
http://blogs.infragistics.com/blogs/cshoemaker/archive/2008/11/06/webdatagrid-ajax-master-detail.aspx
Hope this helps,
Craig
Craig,
Thanks for the reply, it's working now
However, if you turn on the paging behaviour, your solution isn't working completely since the row_index on a new page starts at 0 again resulting in not being able to find the span tag (since the "index" field from the codebehind file isn't restarting). I fixed this by calculating the id of the span tag by myself by doing something like this:
var behaviors = grid.get_behaviors();var selection = behaviors.get_selection();var paging = behaviors.get_paging();
var rowIndex = selectedRow.get_index();if (paging){ rowIndex += (paging.get_pageSize() * paging.get_pageIndex());}
var Id = $get("b" + rowIndex).innerHTML;