Radgrid not refreshing after ajax and rebind

40 posts, 0 answers
  1. Megan
    Megan avatar
    5 posts
    Member since:
    Jan 2011

    Posted 21 Mar 2011 Link to this post

    Thank you
  2. ravi
    ravi avatar
    4 posts
    Member since:
    Mar 2011

    Posted 22 Mar 2011 Link to this post

     
    Thank u for reply,
    Here is my asp code,when i clicked on the 1st grid event,2nd grid was binding successfully.but when i clicking on the
    "Add New Activity"(anchore tag of 'command item template' on below code)was not showing pop up.

    <%@ Page Language="C#" MasterPageFile="~/Member/MemberMaster.Master" AutoEventWireup="true"
        CodeBehind="MyActivity.aspx.cs" Inherits="Virtu.WebUI.MyActivity" %>
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
            <tr>
                <td width="70%" align="left" valign="top" style="padding-top: 8px; padding-left: 10px;">
                    <table width="100%" height="70%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="12" height="33" align="left" valign="top" background="../Images/box-img2.gif"
                                bgcolor="#FFFFFF">
                                <img src="../Images/box-img1.gif" width="12" height="36" />
                            </td>
                            <td width="100%" align="center" valign="top" background="../images/box-img2.gif"
                                class="heading-orange" style="padding-top: 6px;">
                                All Activities List
                            </td>
                            <td width="12" align="right" valign="top" background="../Images/box-img2.gif" bgcolor="#FFFFFF">
                                <img src="../Images/box-img3.gif" width="12" height="36" />
                            </td>
                        </tr>
                        <tr>
                            <td align="left" valign="top" colspan="3" width="100%">
                                <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                                    <script type="text/javascript">
                                        function ShowEditForm(id, rowIndex) {
                                            var grid = $find("<%= RadGrid1.ClientID %>");
     
                                            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                                            grid.get_masterTableView().selectItem(rowControl, true);
     
                                            window.radopen("ActivityEntry.aspx?ActivityID=" + id, "UserListDialog");
                                            return false;
                                        }
                                        function ShowInsertForm() {
                                            debugger;
                                            var groupid = '<%=Request.QueryString["GroupID"].ToString()%>';
     
                                            window.radopen("ActivityEntry.aspx?GroupID=" + groupid, "UserListDialog");
                                            return false;
                                        }
                                        function refreshGrid(arg) {
                                            if (!arg) {
                                                $find("< % = RadAjaxManager1.ClientID % >").ajaxRequest("Rebind");
                                            }
                                            else {
                                                $find("< % = RadAjaxManager1.ClientID % >").ajaxRequest("RebindAndNavigate");
                                            }
                                        }
                     
                                    </script>
                                </telerik:RadCodeBlock>
                                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                                    <clientevents onrequeststart="onRequestStart" />
                                    <ajaxsettings>
         <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"  />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            </ajaxsettings>
                                </telerik:RadAjaxManager>
                                <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Vista" AllowPaging="True" Width="97%"
                                    ShowHeader="false" ondeletecommand="RadGrid1_DeleteCommand" onitemcommand="RadGrid1_ArchiveCommand"
                                    onitemcreated="RadGrid1_ItemCreated" onneeddatasource="RadGrid1_NeedDataSource">
                                    <pagerstyle mode="NumericPages" />
                                    <mastertableview autogeneratecolumns="False" datakeynames="ActivityID" width="100%"
                                        commanditemdisplay="Top" pagesize="5">
                        <Columns>
                            <telerik:GridBoundColumn
                                DataField="ActivityID" 
                                  
                                ReadOnly="True"
                                SortExpression="ActivityID"
                                UniqueName="ActivityID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn
                                DataField="ActivityName"                             
                                SortExpression="ActivityName"
                                UniqueName="ActivityName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn
                                DataField="ActivityDescription"                            
                                SortExpression="ActivityDescription"
                                UniqueName="ActivityDescription">
                            </telerik:GridBoundColumn>
                              <telerik:GridDateTimeColumn                            
                               DataField="StartDate"
                               UniqueName="StartDate"
                               SortExpression="StartDate"
                               HeaderStyle-Width="110px"
                               DataFormatString="{0:d}" />
                               <telerik:GridDateTimeColumn                          
                               DataField="EndDate"
                               UniqueName="EndDate"
                               SortExpression="EndDate"
                               HeaderStyle-Width="110px"
                               DataFormatString="{0:d}" />
                                                                  
                            <telerik:GridTemplateColumn
                                UniqueName="TemplateEditColumn">
                                <ItemTemplate>
                                    <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>                            
                             <telerik:GridButtonColumn     CommandName="Archive" Text="Archive" ConfirmDialogType="RadWindow"
                                ConfirmText="Do you want to archieve the Activity" UniqueName="ActivityID">
                            </telerik:GridButtonColumn>
                            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" ConfirmDialogType="RadWindow"
                                ConfirmText="Do you want to delete the Activity" UniqueName="CategoryID" >
                            </telerik:GridButtonColumn>
                               <telerik:GridButtonColumn CommandName="Event" Text="Events"
                                  UniqueName="Eventclm">
                            </telerik:GridButtonColumn>
                        </Columns>
                        <CommandItemTemplate >
                            <a href="#" onclick="return ShowInsertForm();">Add New Activity</a>
                            
                        </CommandItemTemplate>
                    </mastertableview>
                                    <clientsettings>
                        <Selecting AllowRowSelect="true" />                   
                    </clientsettings>
                                </telerik:RadGrid>
                                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td width="12" height="33" align="left" valign="top" background="../Images/box-img2.gif"
                                            bgcolor="#FFFFFF">
                                            <img src="../Images/box-img1.gif" width="12" height="36" />
                                        </td>
                                        <td width="100%" align="center" valign="middle" background="../images/box-img2.gif"
                                            class="heading-orange">
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="20">
                                                    </td>
                                                    <td align="center" class="heading-orange" style="white-space: nowrap;" valign="middle">
                                                        <span id="spanBlogFamilyName" runat="server">My Events</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="12" align="right" valign="top" background="../Images/box-img2.gif" bgcolor="#FFFFFF">
                                            <img src="../Images/box-img3.gif" width="12" height="36" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" valign="top" colspan="3" width="100%">
                                            <telerik:RadGrid AutoGenerateColumns="true" ShowHeader="false" OnItemCreated="RadGrid2_ItemCreated"
                                                ID="RadGrid2" runat="server" Skin="Vista" AllowPaging="True" Width="97%" Height="200px"
                                                EnableAjaxSkinRendering="true">
                                                <pagerstyle mode="NumericPages" />
                                                <mastertableview autogeneratecolumns="False" datakeynames="EventID" width="100%"
                                                    commanditemdisplay="Top" pagesize="5">
                        <Columns>
                            <telerik:GridBoundColumn
                                DataField="EventID" 
                                  
                                ReadOnly="True"
                                SortExpression="EventID"
                                UniqueName="EventID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn
                                DataField="EventName"                             
                                SortExpression="EventName"
                                UniqueName="EventName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn
                                DataField="EventDescription"                            
                                SortExpression="EventDescription"
                                UniqueName="EventDescription">
                            </telerik:GridBoundColumn>
                              <telerik:GridBoundColumn
                                DataField="EventFees"                            
                                SortExpression="EventFees"
                                UniqueName="EventFees">
                            </telerik:GridBoundColumn>                         
                               <telerik:GridButtonColumn
                                CommandName="Archive"
                                Text="Archive"
                                ConfirmDialogType="RadWindow"
                                ConfirmText="Do you want to archieve the Activity"
                                UniqueName="eventarchive">
                            </telerik:GridButtonColumn>
                            <telerik:GridButtonColumn
                            CommandName="Deleteevent"
                            Text="Delete"
                            ConfirmDialogType="RadWindow"
                            ConfirmText="Do you want to delete the Activity"
                            UniqueName="eventDelete">
                            </telerik:GridButtonColumn>                                                            
                            <telerik:GridTemplateColumn
                                UniqueName="evenTemplateEditColumn">
                                <ItemTemplate>
                                    <asp:HyperLink ID="EditLinks" runat="server" Text="Edit"></asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>                            
                             
                             
                        </Columns>
                        <CommandItemTemplate>
                            <a href="#" onclick="return ShowInsertForm();"  >Add New Event</a>
                        </CommandItemTemplate>
                    </mastertableview>
                                                <clientsettings>
                        <Selecting AllowRowSelect="true" />
                    </clientsettings>
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                </table>
                                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">
                                    <windows>
                        <telerik:RadWindow Skin="Vista"  ID="UserListDialog" runat="server" Title="User List Dialog" Height="400px"
                            Width="600px" Left="150px" ReloadOnShow="true" Modal="true"  />
                    </windows>
                                </telerik:RadWindowManager>
                                <asp:Panel ID="pnlMyGroupMessage" runat="server" Width="100%" Height="125px" CssClass="mediumred"
                                    Visible="false">
                                    No entries posted.</asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" valign="top" colspan="3" width="100%" style="padding-top: 3px;">
                            </td>
                        </tr>
                        <tr style="visibility: hidden; display: none;">
                            <td>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                </td>
            </tr>
        </table>
    </asp:Content>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. GP
    GP avatar
    58 posts
    Member since:
    Oct 2009

    Posted 22 Mar 2011 Link to this post

    Have you tried to click on "Add New Event"?  Does it fire properly?  Does it work when you click edit?  

    I would try commenting out these lines:
    debugger;
    var groupid = '<%=Request.QueryString["GroupID"].ToString()%>';
     
    window.radopen("ActivityEntry.aspx?GroupID=" + groupid, "UserListDialog");

    and just call the following code to see if it opens:
    window.radopen("ActivityEntry.aspx", "UserListDialog")
  5. ravi
    ravi avatar
    4 posts
    Member since:
    Mar 2011

    Posted 25 Mar 2011 Link to this post

    Hi GP
    sry  for late reply... its urgent requirement so i did it in normal asp controls.

    Yes,i  have  tried to click on "Add New Event"it doesnt fire properly.even i checked click 'edit'.it doesnt work.but before binding the 1st grid to 2nd grid it worked good, not now
  6. Gabriel
    Gabriel avatar
    3 posts
    Member since:
    Mar 2012

    Posted 30 Apr 2012 Link to this post

    You guys seem like your more knowledgeable than I! I'm having the grid refresh issue...go figure :) Database receives inserted record but expanded detail table doesn't show it unless I either set viewstate to false(that collapses detail grid) or manually expand and collapse detail table. I'm open to any suggestions...

    Here's my setup:

    Main.Master
    <%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Main.Master.vb" Inherits="FOS.NET.Main" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <link rel="stylesheet" type="text/css" href="../common/RAMPS.css" />
        <link rel="stylesheet" type="text/css" href="../common/subModal.css" />
        <!--Remove this link when going to production -->
        <link rel="stylesheet" type="text/css" href="../RAMPS.css" />
        <title>FOS</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        </telerik:RadAjaxManager>
      
    <!-- Code removed for brevity -->
     
        </form>
    </body>
    </html>

    Main.Master.vb
    Imports Telerik.Web.UI
    Imports System.Web.Services
    Imports System.Data.SqlClient
      
    Partial Public Class Main
        Inherits System.Web.UI.MasterPage
        Friend Event RebindDetailGrid As CommandEventHandler
      
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      
        End Sub
      
        Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
            'handle the manager AjaxRequest event here
            If e.Argument = "CashCashEquivalents_BindData" Then
                RaiseEvent RebindDetailGrid(Me, New CommandEventArgs("BindDetailGrid", e.Argument.ToString))
            End If
        End Sub
      
    End Class

    Content Page AssetSchedule:
    <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Main.Master"
        CodeBehind="AssetSchedule.aspx.vb" Inherits="FOS.NET.AssetSchedule" %>
     
    <%@ MasterType VirtualPath="~/Main.Master" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
     
            <script type="text/javascript">
                function openRadWindow(url, windowName, x, y) {
                    var radWindow1 = $find("<%= RadWindow1.ClientID %>");
     
                    radWindow1.show();
                    radWindow1.setSize(x, y);
                    radWindow1.center();
                    radWindow1.setUrl(url);
                    radWindow1.set_title(windowName);
                }
                 
                function ShowInsertForm(url) {
                    var radgrid = $find('<%= RadGridAssetSchedule.ClientID %>');
                    var clientID = radgrid.get_masterTableView().get_dataItems()[0].getDataKeyValue("ClientID");
                    openRadWindow(url + clientID, 'Insert New Record', 540, 450);
     
                    return false;
                }
                 
                function OnClientClose(sender, args) {
                    if (args.get_argument() != null) {
                        var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
                        //alert("'" + sender.get_name() + "'" + " was closed and returned the following argument: '" + args.get_argument() + "'");
                        ajaxManager.ajaxRequest(args.get_argument());
                    }
                }
     
            </script>
     
        </telerik:RadCodeBlock>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderBody" runat="server">
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridAssetSchedule" />
                        <telerik:AjaxUpdatedControl ControlID="CashCashEquivalents" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGridAssetSchedule">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridAssetSchedule" />
                        <telerik:AjaxUpdatedControl ControlID="CashCashEquivalents" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
        <telerik:RadWindow ID="RadWindow1" runat="server" VisibleStatusbar="false" OffsetElementID="offsetElement"
            KeepInScreenBounds="false" OnClientClose="OnClientClose">
        </telerik:RadWindow>
        <telerik:RadGrid ID="RadGridAssetSchedule" runat="server" AllowSorting="True" CellSpacing="0"
            DataSourceID="SqlDataSourceScheduleList" GridLines="None" Skin="Outlook" Font-Size="Small"
            AutoGenerateColumns="False" EnableViewState="False">
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <ClientSettings>
                <Selecting CellSelectionMode="None"></Selecting>
            </ClientSettings>
            <MasterTableView DataSourceID="SqlDataSourceScheduleList" AllowFilteringByColumn="False"
                AllowPaging="False" DataKeyNames="Report,ClientID" ClientDataKeyNames="Report,ClientID"
                Name="ScheduleList" EnableViewState="False">
                <DetailTables>
                    <telerik:GridTableView runat="server" Name="CashCashEquivalents" DataSourceID="SqlDataSourceCashEquivalent"
                        EditMode="InPlace" CommandItemDisplay="Top" ShowFooter="True" AllowAutomaticDeletes="true"
                        AllowAutomaticInserts="true" AllowAutomaticUpdates="True" DataKeyNames="CashEquivalentID,ClientID"
                        ClientDataKeyNames="CashEquivalentID,ClientID">
                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                                ButtonType="ImageButton" EditImageUrl="\images\Edit.png" InsertImageUrl="\images\Edit.png"
                                HeaderText="Edit">
                                <ItemStyle HorizontalAlign="Center" Width="25px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridTemplateColumn UniqueName="TemplateDetailsColumn" HeaderText="Details">
                                <ItemTemplate>
                                    <asp:HyperLink ID="DetailEdit" runat="server" Text="Details" ImageUrl="\images\Detail.png"></asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="25px" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridDropDownColumn DataField="Owner" DataSourceID="SqlDataSourceClientOwnerCodes"
                                FilterControlAltText="Filter Owner column" HeaderText="Owner" ListTextField="OwnerDescription"
                                ListValueField="FOSOwnerCodeID" UniqueName="Owner">
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn FilterControlAltText="Filter column1 column" HeaderText="Description"
                                UniqueName="Description" DataField="Description" MaxLength="100" DefaultInsertValue=" 1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AccountNumber" FilterControlAltText="Filter AccountNumber column"
                                HeaderText="Account Number" MaxLength="15" UniqueName="AccountNumber" DefaultInsertValue="2">
                                <HeaderStyle Width="110px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Purpose" FilterControlAltText="Filter Purpose column"
                                HeaderText="Purpose" MaxLength="10" UniqueName="Purpose" DefaultInsertValue="3">
                            </telerik:GridBoundColumn>
                            <telerik:GridNumericColumn DataField="Rate" DataType="System.Decimal" DecimalDigits="2"
                                FilterControlAltText="Filter InterestRate column" HeaderText="Interest Rate"
                                UniqueName="InterestRate" DefaultInsertValue="4">
                                <HeaderStyle Width="80px" />
                            </telerik:GridNumericColumn>
                            <telerik:GridDateTimeColumn DataField="ValuationDate" DataType="System.DateTime"
                                FilterControlAltText="Filter ValuationDate column" HeaderText="Valuation Date"
                                UniqueName="ValuationDate" DataFormatString="{0:MM/dd/yyyy}" DefaultInsertValue="01/01/2012">
                                <HeaderStyle Width="130px" />
                            </telerik:GridDateTimeColumn>
                            <telerik:GridNumericColumn DataField="MarketValue" DataType="System.Decimal" DecimalDigits="2"
                                FilterControlAltText="Filter MarketValue column" HeaderText="Market Value" NumericType="Currency"
                                UniqueName="MarketValue" Aggregate="Sum" FooterAggregateFormatString="{0:C}"
                                DefaultInsertValue="5">
                                <HeaderStyle Width="100px" />
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="FOSAssetOXM2ID" DataType="System.Int64" DecimalDigits="2"
                                Display="False" FilterControlAltText="Filter FOSAssetOXM2ID column" HeaderText="FOSAssetOXM2ID"
                                UniqueName="FOSAssetOXM2ID">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="CashEquivalentID" DataType="System.Int64" DecimalDigits="2"
                                Display="False" FilterControlAltText="Filter CashEquivalentID column" HeaderText="CashEquivalentID"
                                UniqueName="CashEquivalentID">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Schedule" DataType="System.Int64" DecimalDigits="2"
                                Display="False" FilterControlAltText="Filter Report column" HeaderText="Schedule"
                                UniqueName="Schedule">
                            </telerik:GridNumericColumn>
                            <telerik:GridButtonColumn ConfirmText="Delete this Asset?" ConfirmDialogType="RadWindow"
                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                UniqueName="DeleteColumn" HeaderText="Delete">
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" Width="25px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="ClientID" Display="False" FilterControlAltText="Filter ClientID column"
                                HeaderText="ClientID" UniqueName="ClientID">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <CommandItemTemplate>
                            <a href="#" onclick="return ShowInsertForm('/ScheduleDetailForms/DetailCashEquivalents.aspx?ClientID=');">
                                Add New Record</a>
                        </CommandItemTemplate>
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                    </telerik:GridTableView>
                </DetailTables>
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Type" FilterControlAltText="Filter Type column"
                        HeaderText="Type" ReadOnly="True" SortExpression="Type" UniqueName="Type">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column"
                        HeaderText="Description" ReadOnly="True" SortExpression="Description" UniqueName="Description">
                        <HeaderStyle Width="950px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Report" FilterControlAltText="Filter Report column"
                        HeaderText="Report" ReadOnly="True" SortExpression="Report" UniqueName="Report"
                        DataType="System.Int32" Display="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FOSAssetScheduleLinkID" DataType="System.Int32"
                        Display="False" FilterControlAltText="Filter FOSAssetScheduleLinkID column" HeaderText="FOSAssetScheduleLinkID"
                        ReadOnly="True" SortExpression="FOSAssetScheduleLinkID" UniqueName="FOSAssetScheduleLinkID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OXM2ClientID" Display="False" FilterControlAltText="Filter OXM2ClientID column"
                        HeaderText="OXM2ClientID" ReadOnly="True" SortExpression="OXM2ClientID" UniqueName="OXM2ClientID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ClientID" DataType="System.Int32" Display="False"
                        FilterControlAltText="Filter ClientID column" HeaderText="ClientID" ReadOnly="True"
                        SortExpression="ClientID" UniqueName="ClientID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OrderBy" DataType="System.Int32" Display="False"
                        FilterControlAltText="Filter OrderBy column" HeaderText="OrderBy" ReadOnly="True"
                        SortExpression="OrderBy" UniqueName="OrderBy">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MissingPricingData" FilterControlAltText="Filter MissingPricingData column"
                        HeaderText="Missing Pricing Data" ReadOnly="True" SortExpression="MissingPricingData"
                        UniqueName="MissingPricingData">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
    </asp:Content>

    AssetSchedules.aspx.vb
    Imports Telerik.Web.UI
    Partial Public Class AssetSchedule
        Inherits System.Web.UI.Page
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            AddHandler Master.RebindDetailGrid, AddressOf RebindDetailGrid
        End Sub
        Friend Sub RebindDetailGrid(ByVal sender As Object, ByVal e As CommandEventArgs)
            Dim item As GridDataItem = DirectCast(RadGridAssetSchedule.Items(0), GridDataItem)
            'Accessing first item
            Dim tableView As GridTableView = DirectCast(item.ChildItem.NestedTableViews(0), GridTableView)
            ' rebind DetailTable of first item
            tableView.Rebind()
        End Sub
    End Class

    DetailCashEquivalents.aspx (Popup Window from AssetSchedules)
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DetailCashEquivalents.aspx.vb"
        Inherits="FOS.NET.DetailCashEquivalents" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <link rel="stylesheet" type="text/css" href="../common/RAMPS.css" />
        <link rel="stylesheet" type="text/css" href="../common/subModal.css" />
        <!--Remove this link when going to production -->
        <link rel="stylesheet" type="text/css" href="../RAMPS.css" />
     
        <script language="javascript" type="text/javascript">
            function textCounter(field, countfield, maxlimit) {
                if (field.value.length > maxlimit)
                    field.value = field.value.substring(0, maxlimit);
                else
                    countfield.value = maxlimit - field.value.length;
            }
     
            function pageLoad() {
                //txtInput = document.getElementById('txtUserInput');
                var currentWindow = GetRadWindow();
                //txtInput.value = currentWindow.argument;
            }
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                return oWindow;
            }
     
            function Close() {
                GetRadWindow().Close(null);
            }
     
            function ReturnArgs() {
                var oWindow = GetRadWindow();
                oWindow.close('CashCashEquivalents_BindData');
            }         
        </script>
     
        <title>Cash & Equivalents Detail</title>
        <style type="text/css">
            .columnStyle1
            {
                width: 230px;
            }
        </style>
    </head>
    <body>
        <form id="form2" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <asp:Label ID="LabelRadWindowClose" runat="server" Width="410px"></asp:Label>
        <%--Label used for closing window--%>
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="CashEquivalentID" DataSourceID="SqlDataSourceCashEquivalent"
            DefaultMode="Insert">
              <!-- Edited for brevity -->
        </asp:FormView>
       <!-- Edited for brevity -->
        </form>
    </body>
    </html>
  7. Gabriel
    Gabriel avatar
    3 posts
    Member since:
    Mar 2012

    Posted 02 May 2012 Link to this post

    Problem fixed. Telerik you need better / easier documentation on the master / detail page, radgrid & detail table, insert record with a popup window. All the examples you have just couldn't quite get me there. Was so close, but just couldn't get the detail grid to refresh. Here is the forum (Telerik you have great forums!) that I used to solve the issue.

    Help with Javascript Rebind - Posted on Mar 27, 2008

    Solved by Chris Ruegsegger - Posted on Aug 13, 2008

    http://www.telerik.com/community/forums/aspnet-ajax/grid/help-with-javascript-rebind.aspx#606974
    http://www.telerik.com/community/forums/aspnet-ajax/grid/help-with-javascript-rebind.aspx#2093389
  8. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 25 Sep 2012 Link to this post

    Hello

    it's possible to reactivate the demo link ,all link in the forum doesn't work

    http://demos.telerik.com/aspnet/prometheus/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx?product=grid

    thanks
    Olivier
  9. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Sep 2012 Link to this post

    Hi,

    Here is the link.
    Grid / Window Editing

    Thanks,
    Princy.
  10. shruti
    shruti avatar
    2 posts
    Member since:
    Jun 2015

    Posted 21 Jul Link to this post

    I have a page with four Radtabs on it and in one of the  tab I have a RadGrid and a Gridbuttoncoloumn.

    On click of gridbuttoncoloumn, i want it to redirect it to another tab on the same page..In the Radgrid1_itemcommand event, i am checking the command name of my button coloumn and redirecting it to other tab something like this

    radtabstrip1.selectedindex =2;

    radmultipage1.selectedindex = 2;

    but its not working as expected.

  11. Brent
    Brent avatar
    1 posts
    Member since:
    May 2015

    Posted 17 Aug Link to this post

    Hey guys,

    I decided to post the solution to my problem. I was given this project and it contained both the RadAjaxPanel and RadAjaxManager. In the documentation it notes that using these together can cause problems here:

    "If the same control is placed in a RadAjaxPanel as well as included in RadAjaxManager settings as an AJAXified control (i.e., it is AJAXified by both the RadAjaxPanel and RadAjaxManager),the RadAjaxManager's setting will not work."

    It seems to be common sense but just in case someone is still having this issue, double check this. In my case, I just had to move my client-side radgrid rebinding to server-side withing my OnAjaxRequest method. I don't know if this will help anyone but there you go.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017