This question is locked. New answers and comments are not allowed.
Justin Stuparitz
Top achievements
Rank 1
Justin Stuparitz
asked on 25 Feb 2010, 07:26 PM
Hi all,
What's the easiest way to invoke a plan old action method when a user clicks a row in the grid. I need to pass an id as well. Don't want to do ajax here. Just a plan old get.
thanks,
Justin
What's the easiest way to invoke a plan old action method when a user clicks a row in the grid. I need to pass an id as well. Don't want to do ajax here. Just a plan old get.
thanks,
Justin
4 Answers, 1 is accepted
0
Hello Justin Stuparitz,
The easiest way is to add a Template column which outputs an ActionLink:
<% Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Add(o => o.OrderID);
columns.Add(o =>
{
%>
<%= Html.ActionLink("Select", "Action", "Controller", new { id = o.OrderID }) %>
<%
}
})
.Render();
%>
I hope this helps,
Atanas Korchev
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.
The easiest way is to add a Template column which outputs an ActionLink:
<% Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Add(o => o.OrderID);
columns.Add(o =>
{
%>
<%= Html.ActionLink("Select", "Action", "Controller", new { id = o.OrderID }) %>
<%
}
})
.Render();
%>
I hope this helps,
Atanas Korchev
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
Justin Stuparitz
Top achievements
Rank 1
answered on 26 Feb 2010, 01:28 PM
Hi Atanas,
Thanks. I'm aware of the template column with a link, but what I'm really trying to do is to add an onclick event for the entire row.
Is there any way to set this up in the grid without using jquery?
thanks,
Justin
Thanks. I'm aware of the template column with a link, but what I'm really trying to do is to add an onclick event for the entire row.
Is there any way to set this up in the grid without using jquery?
thanks,
Justin
0
Hi Justin Stuparitz,
No, there isn't. However using jQuery should not be such a problem in this case. What are your reasons against using jQuery?
Regards,
Atanas Korchev
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.
No, there isn't. However using jQuery should not be such a problem in this case. What are your reasons against using jQuery?
Regards,
Atanas Korchev
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
Justin Stuparitz
Top achievements
Rank 1
answered on 26 Feb 2010, 01:36 PM
laziness. that's all.