I have a Gridbound (label) column and a imagebutton in a template column of a radgrid.
How can I open up a new page (like modal pop up, not exactly pop up) when clicked on imagebutton which takes an id and populates session variables of that page to display details?
Any pointers would be highly appreciated.
6 Answers, 1 is accepted
I hope RadWindow will be suitable for your need.
In the ItemCreated event of RadGrid, access the ImageButton in TemplateColumn, attach "onclick" event to the button by passing the id/index. Now in the event handler, open the window and use the url querystring to pass the parameter to newly opened window.
A similar scenario is shown in this demo (Here used HyperLink to open window). I hope this would be a startoff yfor you.
Edit Dialog for RadGrid
Thank you for the reply.
I will try using radwindow but is it possible to do the following:
2. Same time I will also give a command name and handle in itemcommand event to set the session variables required to open the page.
3. Can i give a non-modal type.
I guess it would not work. Or can I open the radwindow on server side code when button is clicked so that I can set session variables before the window is displayed.
One more thing, I will use radwindow just to display the a page by giving url , It would not require any other functionality, as the page just has close button.
Hope you got me what i am looking for.
I believe the code shown in the following forum will take care of your scenario.
Windows driven by server-side codes
In the ItemCommand event save the session value and open the window using server code. Set the Modal property of window to "false" if you do not need modal window.
Thats it! :)
The itemcommand event doesnt fire on click on asp:button in template column.
Code looks like:
<telerik:GridTemplateColumn HeaderText=" Number" SortExpression ="Number" DataField="Number"
<asp:Label ID="label1" Text='<%# Eval("Number") %>'
<asp:ImageButton ID="imgbtnDetais" CommandName="View" ImageUrl="~/Images/popup.gif"
I am trying to open the window in itemcommand when command is View, but the event doesnt fire.
Am I missing anything?
The provided code looks ok to me and there are no reasons for the ItemCommand event to not fore correctly in this case. Could you please open regular support ticket and send us runnable application so we could test it locally and advise you further.
the Telerik team
The provided code looks ok to me and there are no reasons for the ItemCommand event to not fire correctly in this case. Could you please open regular support ticket and send us runnable application so we could test it locally and advise you further.
the Telerik team