Hi,
I'm using a HyperLink column in a webGrid. Clicking the hyperLink opens a new window, but the new opened window does not get the focus.
I did it by:
CEIDCell.Column.Type = ColumnType.HyperLink;
CEIDCell.AllowEditing = AllowEditing.No;
How can I cause the new window get the focus?
Thanks
Maya
Intel
Hey HBA,
Thank you soooooooooo much...
i tried it and it works successfully.....
Naveen,
Thanks a lot for the solution.
Cheers.
Great solution! I'm going to try this on a new grid I need that must client sort. Thanks for posting this.
For my case I had the client side sorting enable and could not lose the mouse down event handler like HBA's post above.
I made some modifications to the javascript.
First you need to try catch the code so that when the header is clicked a javascript error is not thrown.
-----------------------------------------------------------
function grid_MouseDownHandler(gridName, id, button)
{
var oGrid = igtbl_getGridById(gridName);
var oCell = igtbl_getCellById(id); try { var cellName = oCell.Column.Key.toLowerCase(); switch(cellName) { case "hyperlinkcellname": return true; break; default: return false; } } catch(e) { return false; }
}
Set client side event handler as below.
<ClientSideEvents MouseDownHandler="grid_MouseDownHandler">
------------------------------------------------------------
This way I was able to skip the js code when the click is not from the hyper link column.
Hope this helps.
Naveen
In my world, sorting is off. But I'm wondering if it's possible on the client side to detect that a header was clicked, and if so do a sort?