This is a migrated thread and some comments may be shown as answers.

Gridbound and imagelinkbutton in radgrid

6 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PV
Top achievements
Rank 1
PV asked on 10 Aug 2010, 01:01 PM
Hello team,

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

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Aug 2010, 01:38 PM
Hi,


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


Thanks,
Princy.
0
PV
Top achievements
Rank 1
answered on 11 Aug 2010, 06:09 AM

Hi Princy,

Thank you for the reply.

I will try using radwindow but is it possible to do the following:

 

1. I would use imagebutton and handle onclientclick to show radwindow in javascript.

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.

0
Princy
Top achievements
Rank 2
answered on 11 Aug 2010, 07:35 AM
Hello,


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! :)

Thanks,
Princy.
0
PV
Top achievements
Rank 1
answered on 11 Aug 2010, 11:14 AM
Hi Princy,

The itemcommand event doesnt fire on click on asp:button in template column.
Code looks like:

 

<telerik:GridTemplateColumn HeaderText=" Number" SortExpression ="Number" DataField="Number"

 

 

UniqueName="TemplateColumn">

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="label1" Text='<%# Eval("Number") %>'

 

 

runat="server"></asp:Label>

 

 

<asp:ImageButton ID="imgbtnDetais" CommandName="View" ImageUrl="~/Images/popup.gif"

 

 

runat="server" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

I am trying to open the window in itemcommand when command is View, but the event doesnt fire.

Am I missing anything?

 

0
Maria Ilieva
Telerik team
answered on 16 Aug 2010, 12:31 PM
Hello,

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.


Greetings,
Maria Ilieva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Maria Ilieva
Telerik team
answered on 16 Aug 2010, 12:31 PM
Hello,

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.


Greetings,

Maria Ilieva
the Telerik team

 

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
PV
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
PV
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or