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

[Solved] Details View based on selected Grid row

1 Answer 88 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
orim
Top achievements
Rank 1
orim asked on 11 Jul 2012, 01:47 PM
Hi,
i want to show a detailsview window on selected row grid.
<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of IEnumerable(Of Ares4AgsmDbModels.RequestQueue))" %>
 
<script type="text/javascript">
 
    function OnRowSelect(sender, args) {
        $('#Window').data('tWindow').center().open();
    }
</script>
 
 
 
 
<%: Html.Telerik.Grid(Model).Name("GridRequestsByLogin") _
    .Sortable _
    .Scrollable _
    .Selectable _
    .Filterable _
    .DataBinding(Function(ajxbind) ajxbind.Ajax.Select("_AjaxBinding", "RequestQueue")) _
    .Columns(Sub(col)
                 col.Bound("RequestGuid").Hidden(True)
                 col.Bound("Status").ClientTemplate("<img width='16' height='16' alt='<#= Status #>' src='" + Url.Content("~/Content/Images/Status/") + "<#= Status #>.png' />")
                 col.Bound("CTI")
                 col.Bound("ExternalId")
             End Sub) _
     .ClientEvents(Sub(ev) ev.OnRowSelect("OnRowSelect"))
     %>
   
 
    <%: Html.Telerik.Window _
        .Name("Window") _
        .Title("Request details") _
        .Scrollable(True) _
        .Resizable _
        .Draggable(True) _
        .Width(600) _
        .Height(400) _
        .Visible(False) _
        .Modal(True) _
        .Buttons(Sub(bt) bt.Maximize.Close()) _
        .LoadContentFrom("Details", "RequestQueue", New With {.id = "{0}"}) <---- when passing hardcoded ID it works but
                                                                              here i want to pass the selected grid row ID to the details view
         
       %>
     
   
         

can someone help ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 12 Jul 2012, 03:03 PM
Hi Miroslav,

Basically in your case you do not need to set any Content or to use LoadContentFrom method. You need to use the client object of the window to perform ajax request via the ajaxRequest method and pass the related ID for the current row.
To get the ID or any other property of the row dataitem you can use the dataItem of the Grid object.

I hope this helps.

Kind regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Window
Asked by
orim
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or