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

Opening RadWindow With Row Click

3 Answers 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 16 Jun 2009, 04:22 PM
I currently have a radgrid that opens a nestedview template like so:
Protected Sub grid_applications_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grid_applications.ItemCommand 
        If e.CommandName = "RowClick" Then 
            Dim item As GridDataItem = e.Item 
            If item.Expanded = True Then 
                item.Expanded = False 
            Else 
                item.Expanded = True 
            End If 
        End If 
    End Sub 
<NestedViewTemplate> 
    <asp:Label ID="GridRec" runat="server" Visible="false" Text='<%# Eval("record") %>' /> 
       <uc1:AppViewer ID="AppViewer1" runat="server" /> 
    </NestedViewTemplate> 

I want to change this now though so that the AppViewer UserControl opens in a RadWindow modal popup.  I am not sure how to do that programmatically as I want it to happen when the row is clicked, not a select link or button.

Also, in the radwinow I will have editing available, so when the radwindow is closed how do I automatically refresh the grid?

Thank you.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 17 Jun 2009, 06:00 AM
Hi Shawn,

Go through the online demo which explains how to edit a RadGrid using radwindow on double clicking a Grid row. You may use the same logic in OnRowClick client event.
Window Editing

In the Demo a  refreshGrid  function is used in the client side to rebind the Grid. You may call the same function in the OnClientClose event of the radWindow to rebind the Grid.

Thanks
Shinu


0
Shawn
Top achievements
Rank 1
answered on 17 Jun 2009, 07:06 PM
I am trying to open a RadWindow on the Grid's row click but it is passing NULL as the DataKeyValue and I am not sure why - there is clearly a value...

function RowClick(sender, eventArgs) { 
                    window.radopen("AppWindow.aspx?record=" + eventArgs.getDataKeyValue("record"), "UserListDialog"); 
                } 

The window opens exactly as I want it to but there is no "record" value.  It is specified in my grid and even displayed, so why wouldn't this be coming across.

  <telerik:RadGrid ID="grid_applications" runat="server"  
        DataSourceID="applications" GridLines="None"  
        PageSize="50"
... 
<MasterTableView autogeneratecolumns="False" datakeynames="record"  
            datasourceid="applications" CommandItemDisplay="None"
.... 
 
<ClientSettings AllowDragToGroup="True"   
            EnableRowHoverStyle="True" ClientEvents-OnRowClick="RowClick"
        </ClientSettings> 



No idea why I am not getting the "record" value...


0
Shinu
Top achievements
Rank 1
answered on 18 Jun 2009, 08:07 AM
Hi Shawn,

You need to set the ClientDataKeyNames. Try setting it as shown below.

ASPX:
 
<MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="record"  CommandItemDisplay="None"    datasourceid="applications"  DataKeyNames="record" > 
 


Thanks
Shinu.
Tags
Grid
Asked by
Shawn
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Shawn
Top achievements
Rank 1
Share this question
or