I have a grid and one cell is Hyperlink. Once the user click that link, I have to do a postback, do some processing and then open up a popup. What is the best approach? Is hyperlink that right column type? Which serverside event I should tap into to do the serverside processing and then what I have to do to open the popup?
Thanks,
Vinod
Hello,
I think the best option would be the Page.ClientScript class and the set of register methods it provides, for example RegisterClientStartupScript. A good example for this is demonstrated here:
http://forums.asp.net/p/1060981/1525852.aspx#1525852
When I click on HyperLink, its doing a post back and firing the Grid_Click(object sender, ClickEventArgs e) event. Here I was able to check e.Cell.Key and based on its value, I am doing ScriptRegistration to launch a popup.
Thanks for the sugession and it helped me. Please let me know if I am intercepting the correct event?
I think the igtbl_doPostBack function documented here might be closer to what you need:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebGrid_Utility_Functions_CSOM.html
Forces postback to the server through the WebGrid's routine.
String. Grid's id to perform postback off.
I am now running into a conflict. Becuse I subscribed to Click event, now the columns that are editable are doing a postback even before I start typing. I am thinking of not to use Click event, and instead use the client side event (javascript), but not sure how to use it. What do I need to pass to __doPostBack(gridName, ''); for me to overcome the Click event problem?
grid_CellClickHandler(gridName, cellId, button)
{
var cell = igtbl_getCellById(cellId); if (cell.Column.Key == "COLKEY") { __doPostBack(gridName, ''); }
}
Glad I was able to help. From what I see, the Grid.Click event is exactly what you need -- if it works for you, you can keep it that way.