-1

How to reset a previously selected row and highlight a new row in inlinenav JQGrid. Please help..

var lastSel = null;
function onSelectRow(id) {
if (lastSel != id) {
    $("#ProgramListGird").jqGrid('restoreRow', lastSel, function () { });
    //$('#ProgramListGird').jqGrid('resetSelection', lastSel, true); 
    lastSel = id;
}
$("programListGird").setSelection(id);
editparameters = {
    "keys": false,
    "oneditfunc": null,
    "successfunc": null,
    "url": null,
    "extraparam": {},
    "aftersavefunc": null,
    "errorfunc": null,
    "afterrestorefunc": null,
    "restoreAfterError": true,
    "mtype": "POST"
}
$("#ProgramListGird").jqGrid('editRow', id, editparameters);   
 }

//$('#ProgramListGird').jqGrid('resetSelection', lastSel, true); - if i use this line of code then my restore functionality is not working. Means that, on each row select the rows are getting in to edit mode but not restored which is actually a wrong behavior. Please help..

Kavitha P.
  • 145
  • 2
  • 11

2 Answers2

0

Usually Adding [STAThread] Attribute to your method solves the problem. For example:

[STAThread]
private void f() 
{
  ...
}
uncommon_name
  • 412
  • 1
  • 5
  • 18
0

When you want to access OLE functions (like copy to clipboard) you need a single thread application.

[STAThread]
public static void Main()
{
    ...        
}

But maybe this can help you along ZeroClipboard for copy to clipboard in ASP.NET MVC...

Community
  • 1
  • 1
stefankmitph
  • 3,038
  • 2
  • 16
  • 22