Proper use of rad ajax manager

9 posts, 0 answers
  1. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 06 Aug 2014 Link to this post

    hi,
    i am having
    1] three dropdown populates based on each other.
    2] grid populates on the 3 dropdown combination
    3] i can edit record or add new record.

    given code till i manageble, it works for 3 dropdown and shows grid but i am not able to click on edit or add new activity.

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
     
        var column = null;
        function MenuShowing(sender, args) {
                }
     
        function filterMenuShowing(sender, eventArgs) {
            
        }
     
        function RowSelected(sender, eventArgs) {
        }
     
        function CheckSelected() {
     
        }
     
        function validateCombo(source, args) {
         
            }
     
        }
     
    </script>
    </telerik:RadCodeBlock>
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
    <script type="text/javascript" id="telerikClientEvents1">
    //<![CDATA[
     
        function radtxtClient_OnValueChanged(sender, args) {
            //Add JavaScript handler code here
        }
    //]]>
    </script>
    </telerik:RadCodeBlock>
     
     
     
     
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PanelLabel">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="FY"/>
                   <telerik:AjaxUpdatedControl ControlID="lblFY"/>
                   <telerik:AjaxUpdatedControl ControlID="Asg"/>
                   <telerik:AjaxUpdatedControl ControlID="lblAsg"/>
                   <telerik:AjaxUpdatedControl ControlID="Task" />
                   <telerik:AjaxUpdatedControl ControlID="lblTask" />
                   <telerik:AjaxUpdatedControl ControlID="PanelGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
     
     
            <telerik:AjaxSetting>
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="PanelGrid"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
     
    <asp:panel ID="PanelLabel" runat="server">
        <table ">
            <tr>
                <td>
                    <telerik:RadComboBox ID="FY" runat="server" AutoPostBack="True" OnSelectedIndexChanged="FY_SelectedIndexChanged"
                        EnableLoadOnDemand="true" OnItemsRequested="FY_ItemsRequested"
                       >
                    </telerik:RadComboBox>
                </td>
                <td >
                    <telerik:RadComboBox ID="Asg" runat="server" AutoPostBack="True"  OnSelectedIndexChanged="Asg_SelectedIndexChanged"
                        EnableLoadOnDemand="true" EnableVirtualScrolling="true" OnItemsRequested="Asg_ItemsRequested"
                      >
                    </telerik:RadComboBox>
                </td>
                <td >
                    <telerik:RadComboBox ID="Task" runat="server" AutoPostBack="True" OnSelectedIndexChanged="Task_SelectedIndexChanged"
                        EnableLoadOnDemand="true" EnableVirtualScrolling="true" OnItemsRequested="Task_ItemsRequested"
                      >
                    </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblFY" runat="server" Text="Label" Visible="False"></asp:Label>
                </td>
                <td >
                    <asp:Label ID="lblAsg" runat="server" Text="Label" Visible="False"></asp:Label>
                </td>
                <td >
                    <asp:Label ID="lblTask" runat="server" Text="Label" Visible="False" ></asp:Label>
                </td>
            </tr>
            
        </table>
    </asp:panel>
    <asp:Panel runat="server" ID="PanelGrid" BackColor="#66CCFF" Visible="False" BorderStyle="Outset">
        <table >
            <tr>
                <td>
                    <telerik:RadGrid ID="radgridTask" runat="server"
                  OnPreRender="radgridTask_PreRender"
                        OnItemCreated="radgridTask_ItemCreated" OnNeedDataSource="radgridTask_NeedDataSource"
                        OnItemCommand="radgridTask_ItemCommand" OnItemDataBound="radgridTask_ItemDataBound"
                        AutoGenerateColumns="False">
                    
                        <ClientSettings AllowColumnsReorder="true" Resizing-AllowResizeToFit="true" EnablePostBackOnRowClick="false"
                            ReorderColumnsOnClient="True">
                            <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True"></Selecting>
                            <Resizing AllowResizeToFit="True"></Resizing>
                        </ClientSettings>
                     
                        <MasterTableView CommandItemDisplay="Bottom" CommandItemSettings-ShowAddNewRecordButton="true"
                            EditMode="PopUp" DataKeyNames="ID" CommandItemSettings-ShowRefreshButton="false"
                            HierarchyLoadMode="Client" >
                            <CommandItemSettings AddNewRecordText="Add New Task-Activity" />
                            <EditFormSettings EditColumn-EditText="Change Acivity Name"
                            >
                                <EditColumn ButtonType="PushButton">
                               
                                
                            </EditFormSettings>
                            <Columns>
                                <telerik:GridClientSelectColumn UniqueName="GridClientSelectColumn" Visible="False">
                                </telerik:GridClientSelectColumn>
                                <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ActivityName" MaxLength="50" FilterControlAltText="Filter column"
                                    HeaderText="Task-Activities" UniqueName="ActivityName">
                                    <HeaderStyle Font-Bold="True" Font-Size="Larger" HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>
                                <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="EditColumn" EditText="Edit"
                                    InsertText="Save">
                                </telerik:GridEditCommandColumn>
                            
                        
                        </MasterTableView>
                    </telerik:RadGrid>
                </td>
            </tr>
            <tr>
                <td valign="top" style="padding-top: 1px">
                    <table width="100%" cellspacing="0">
                        <tr>
                            <td align="left">
                                <asp:Button ID="btnAddtask" runat="server" Text="Add Task-Activity"
                                    Enabled="False" Visible="False" />
                            </td>
                            <td style="width: 25%">
                                <asp:Label ID="lblCreatedBy" runat="server" Text="CreatedBy :" Visible="False" ></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCreatedBy" runat="server" ></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 25%">
                                <asp:Label ID="lblOwner" runat="server" Text="Owner :" Visible="False"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtOwner" runat="server" ></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <tr>
        <td>
        </td>
    </tr>

    Thanks
  2. SANJAY
    SANJAY avatar
    61 posts
    Member since:
    Jun 2012

    Posted 09 Aug 2014 in reply to Swapnil Link to this post

    Swapnil

    I am not very sure, but I guess if you remove the panel and put the RadGrid directly, it might give you the desired result


    Regards



    Sanjay
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 11 Aug 2014 in reply to SANJAY Link to this post

    i cant do like this becuse i used panel in codebehind to visiblity and with flags
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 11 Aug 2014 Link to this post

    Hello Swapnil,

    Please try modifying the Ajax settings on the page as follows:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PanelLabel">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="PanelLabel" />
                   <telerik:AjaxUpdatedControl ControlID="PanelGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PanelGrid">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="PanelGrid"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    Also i noticed that the Insert/Update/Delete Command event are handled in the RadGrid markup, therefore I suppose you intend to use automatic operations. In this case please set the AllowAutomaticInserts/Update/Delete portieres of the Grid control to "true"

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 11 Aug 2014 in reply to Maria Ilieva Link to this post

    This also not working.
  7. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 11 Aug 2014 in reply to Swapnil Link to this post

    Looks like button click event happens but popup ffor both insert & edit not working, is there any issue with popup.
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 Aug 2014 Link to this post

    Hello,

    Have you tried to set the AllowAutomaticInserts/Update/Delete portieres of the RadGrid control to "true"? It appears that you are using automatic operations an din this case setting this properties is obligatory.

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. Swapnil
    Swapnil avatar
    96 posts
    Member since:
    Aug 2013

    Posted 12 Aug 2014 Link to this post

    i tried with it but not working
    like i said it works with inplace edit mode but not working in popup mode
  10. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 14 Aug 2014 Link to this post

    Hello Swapnil,

    I suppose that some js error appear on the page and it prevents the PopUp form opening. Could you please inspect the server response in the browser console and  verify if any js errors occur?

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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