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

Fill in the RadGrid when you click on the Gantt

0 Answers 80 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Bassam
Top achievements
Rank 1
Veteran
Bassam asked on 22 Aug 2020, 03:14 PM

I want to fill RadGrid  when I click on the  In Gantt Tree list .
Use this code and it works fine The problem is the RadGrid is not filling.

<body>
    <form id="form1" runat="server">
          <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager2_AjaxRequest" ></telerik:RadAjaxManager>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <div>
            <telerik:RadGantt ID="RadGantt1" Height="450px" SelectedView="MonthView" ReadOnly="false" runat="server">
            </telerik:RadGantt>
        </div>

    
         <telerik:RadGrid ID="RadGrid1" RenderMode="Lightweight" EnableAriaSupport="true" 
                                                                      runat="server" AllowPaging="True"   AutoGenerateColumns="False" PageSize="6" AllowSorting="True" Skin="Web20" Width="100%"  ShowStatusBar="True"   AllowAutomaticUpdates="True"  AllowAutomaticDeletes="True"  ShowFooter="True"    Font-Bold="True" AllowFilteringByColumn="true"     >
                                                                  <itemstyle backcolor="Gainsboro"   />
                                                                    <GroupingSettings CollapseAllTooltip="Collapse all groups" />
                                                            
                                                                  
                                                                   <MasterTableView AllowAutomaticDeletes="True" EditMode="InPlace" BorderWidth="2px"     AllowMultiColumnSorting="True" AllowSorting="True" 
                                                                       AutoGenerateColumns="False" CommandItemDisplay="Top"  DataKeyNames="ID" PageSize="6" ShowGroupFooter="True"    >
                                                                <CommandItemSettings ShowAddNewRecordButton="False" ShowRefreshButton="False" />
                                                                       <RowIndicatorColumn Visible="False"> </RowIndicatorColumn>
                                                                       <ExpandCollapseColumn Created ="true" ></ExpandCollapseColumn> 
                                                                        <FooterStyle BackColor="#cc6633"></FooterStyle>  
                                                                       <BatchEditingSettings OpenEditingEvent="Click" EditType="Cell"/> 
                            <Columns>                                     
                                  <telerik:GridBoundColumn DataField="Activity_Code"  AllowFiltering="true" HeaderButtonType="TextButton" HeaderText="رقم البند" SortExpression="Activity_Code" > </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="Activity_Name" AllowFiltering="false"  HeaderButtonType="TextButton" HeaderText="إسم البند" SortExpression="Activity_Name"   ItemStyle-Width="200px"  >
                                      <ItemStyle Width="200px" />
                                  </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="Item_Code"  AllowFiltering="true" HeaderText="رقم المادة" SortExpression="Item_Code" > </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="Item_Name"  AllowFiltering="true" HeaderText="إسم الماده" SortExpression="Item_Name" > </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="Qty"  AllowFiltering="false" HeaderText=" الكمية" SortExpression="Qty" > </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="UnitName" AllowFiltering="false" HeaderText="الوحدة " SortExpression="UnitName" > </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="UnitCost"  AllowFiltering="false" HeaderText="سعر الوحدة" SortExpression="UnitCost" > </telerik:GridBoundColumn>
                                  <telerik:GridBoundColumn DataField="Total" AllowFiltering="false"  HeaderText="الإجمالي" SortExpression="Total" > </telerik:GridBoundColumn>                                            
                            </Columns>                          
                        </MasterTableView>
                              <ValidationSettings EnableValidation="true" ValidationGroup="Editsub"/>
                                                               
                      
                                                                  <FilterMenu RenderMode="Lightweight">
                                                                  </FilterMenu>
                                                                  <HeaderContextMenu RenderMode="Lightweight">
                                                                  </HeaderContextMenu>
                     </telerik:RadGrid>
      
            <script type="text/javascript">
            function pageLoad() {
                var $ = $telerik.$;
                var gantt = $find("RadGantt1");

                $(".rgtTask").on("dblclick", function (e) {
                    e.stopPropagation();
                    var $element = $(e.target);
                    if (!$element.is(".rgtTask")) {
                        $element = $element.parents(".rgtTask").first();
                    }

                    var uid = $element.attr("data-uid");
                    var tasks = gantt.get_allTasks();
                    var task;

                    for (var i = 0; i < tasks.length; i++) {
                        if (tasks[i]._uid === uid) {
                            task = tasks[i];
                            break;
                        }
                    }

                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(task.get_id());
                });
 
            }
        </script>
    </form>
</body>

No answers yet. Maybe you can help?

Tags
Gantt
Asked by
Bassam
Top achievements
Rank 1
Veteran
Share this question
or