I have the following code:
<
script type="text/javascript">
function onLoad() {
$(
'tr', this).live('dblclick', function (e) {
alert(
"dblclcik");
var $tr = $(this);
alert($tr.text());
var $table = $tr[0].cells[0].innerHTML;
var $searchid = $tr[0].cells[1].innerHTML;
alert(
"table id:" + $table);
alert(
"search id:" + $searchid);
 
})
}
</
script>
@model
IEnumerable<CdcSoftware.Pivotal.ThinClient.Common.ViewBag.SearchDescriptionsViewModel>
@(Html.Telerik().Grid(Model)
.Name(
"SearchesGrid")
.ClientEvents(events => events
.OnLoad(
"onLoad"))
.Columns(columns =>
{
columns.Bound(o => o.TableId).Visible(
false);
columns.Bound(o => o.SearchID).Visible(
false);
columns.Bound(o => o.Name);
if (ViewData["AllSearches"].ToString() != "false") columns.Bound(o => o.ListType);
columns.Bound(o => o.Permission);
columns.Bound(o => o.CreatedByEmployeeName);
})
I need to read the valus of my tableID and SearchId fields in my double click event and pass it to a controller action. I donot want to display these fields on the grid.
The problem that I am facing is that If I set the Visible to false then the data cannot be read in the double click event.
If I make them hidden, (columns.Bound(o => o.TableId).Hidden(false)) then sorting is not working properly. Data is going haywire.
I also cannot add these columns to the end and make them hidden becuase some of the columns are bound in a conditional manner and hence the ordinal may not always be the same.
What is the resolution to this?