The radgrid table is disappears when choosing a value for any filter on radgrid

0 Answers 93 Views
Ajax AjaxLoadingPanel AjaxPanel Filter Grid
Rafi
Top achievements
Rank 1
Rafi asked on 23 May 2023, 05:27 AM

Please help me to search the error ,

the radgrid table disappear after filtering the search, 
I tried to find any solution a lot but i did not find a solution for this problem

 


aspx code :
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>


 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                                        <AjaxSettings>
                                            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                                                <UpdatedControls>
                                                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                                                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                                                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
                                                    <telerik:AjaxUpdatedControl ControlID="RadGrid4" />
                                                </UpdatedControls>
                                            </telerik:AjaxSetting>
                                        </AjaxSettings>
                            </telerik:RadAjaxManager>
                                    

                            <telerik:RadGrid EnableAriaSupport="true" ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true" PageSize="20" ShowStatusBar="true"
                                 CellSpacing="0" GridLines="None" ClientSettings-EnablePostBackOnRowClick="false" AllowFilteringByColumn="True">
                                <MasterTableView AutoGenerateColumns="false" TableLayout="Fixed" DataKeyNames="REQ_ID" >
                                    <HeaderStyle HorizontalAlign="Center" ForeColor="#009900" Font-Names="Arial" Font-Bold="true" Font-Size="Medium" Height="50px"/>
                                    <Columns>
                                        <telerik:GridMaskedColumn DataField="REQ_ID" HeaderText="رقم الطلب" UniqueName="Req_num_r1" Visible="true" AllowFiltering="false">
                                        </telerik:GridMaskedColumn>
                                        <telerik:GridBoundColumn DataField="EMP_NAME" HeaderText="اسم الموظف/ طالب الخدمة" AllowFiltering="true"  UniqueName="EMP_NAME_ra" Visible="true" HeaderStyle-Width="15%">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="NAME" HeaderText="الخدمة المقدمة" UniqueName="Problem_Name_r1" Visible="true" ColumnGroupName="GeneralInformation">
                                            <FilterTemplate>
                                                <telerik:RadComboBox RenderMode="Lightweight" ID="Problem_NameCombo1" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Problem_Name_r1").CurrentFilterValue %>'
                                                    runat="server" OnClientSelectedIndexChanged="Problem_NameComboIndexChanged1" AutoPostBack="true">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="All" Value="" />
                                                        <telerik:RadComboBoxItem Text="مشكلة في الطباعة" Value="مشكلة في الطباعة" />
                                                        <telerik:RadComboBoxItem Text="سكانر" Value="سكانر" />
                                                        <telerik:RadComboBoxItem Text="مشكلة في الشبكة" Value="مشكلة في الشبكة" />
                                                        <telerik:RadComboBoxItem Text="البريد الحكومي" Value="البريد الحكومي" />
                                                        <telerik:RadComboBoxItem Text="الارشيف" Value="الارشيف" />
                                                        <telerik:RadComboBoxItem Text="موارد" Value="موارد" />
                                                        <telerik:RadComboBoxItem Text="الانترنت" Value="الانترنت" />
                                                        <telerik:RadComboBoxItem Text="جهاز الحاسوب" Value="جهاز الحاسوب" />
                                                        <telerik:RadComboBoxItem Text="حزمة الاوفيس" Value="حزمة الاوفيس" />
                                                        <telerik:RadComboBoxItem Text="موقع الديوان" Value="موقع الديوان" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                                    <script type="text/javascript">
                                                        function Problem_NameComboIndexChanged1(sender, args) {
                                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                            tableView.filter("Problem_Name_r1", args.get_item().get_value(), "EqualTo");
                                                        }
                                                    </script>
                                                </telerik:RadScriptBlock>
                                            </FilterTemplate>
                                        </telerik:GridBoundColumn>
                                        <telerik:GridDateTimeColumn DataField="CREATE_DATE" ItemStyle-CssClass="sm-visible" HeaderText="وقت انشاء الطلب" DataFormatString="{0:g}" UniqueName="Create_date_r1">
                                        </telerik:GridDateTimeColumn>
                                        <telerik:GridBoundColumn DataField="provider" HeaderText="مقدم الخدمة" UniqueName="provider_r1" HeaderStyle-Width="20%">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridDateTimeColumn DataField="END_DATE" HeaderText="وقت تنفيذ الطلب" DataFormatString="{0:g}" UniqueName="END_DATE_r1" Visible="true">
                                        </telerik:GridDateTimeColumn>
                                        <telerik:GridMaskedColumn DataField="Responsiveness" HeaderText="سرعة الانجاز" UniqueName="Responsiveness_r1" AllowFiltering="false">
                                        </telerik:GridMaskedColumn>


                                    </Columns>

                                    <NestedViewTemplate>

                                        <div class="Table" style="background-color: #a7d1e2">

                                            <div class="TableRow col-12">
                                                <div class="TableCell p-3" style="inline-size: 100%; overflow-wrap: break-word;"><b class="text-danger">تفاصيل المشكلة : </b><%# Eval("DESCRIPTION") %> </div>
                                                <div class="TableCell p-2" style="inline-size: 100%; overflow-wrap: break-word;"><b class="text-danger">ملاحظات مقدم الخدمة : </b><%# Eval("NOTE") %> </div>
                                                <div class="TableCell p-2">
                                                    <b class="text-danger">تقييم الخدمة  : 
                                                          <div class="progress-bar" role="progressbar" style="width:100px ;" aria-valuenow='<%# Convert.ToDouble(Eval("FEEDBACK_RATING"))*20 %>' aria-valuemin="0" aria-valuemax="100"><%# Convert.ToDouble(Eval("FEEDBACK_RATING"))*20 %> %</div>

                                                    </b>

                                                </div>
                                            </div>

                                        </div>

                                    </NestedViewTemplate>
                                </MasterTableView>
                                <ClientSettings>
                                    <DataBinding SelectMethod="GetDataAndCount">
                                    </DataBinding>
                                </ClientSettings>
                            </telerik:RadGrid>


Rumen
Telerik team
commented on 25 May 2023, 02:51 PM

Hi Rafi,

Based on the provided code, there are a few reasons why the grid may disappear after filtering. Here are some suggestions to help you troubleshoot the issue:

  • Check for JavaScript errors: Inspect the browser console for any JavaScript errors that might be occurring when the filter is applied. Fixing these errors could resolve the issue.
  • Disable the AJAX to check for more detailed client errors: Disable the AJAX and test again to see if the issue is not caused by the ajaxification of the grid. See this article for more information: Get more descriptive errors by disabling AJAX.
  • Verify the Ajax settings: Ensure that the RadGrid and other related controls (RadGrid2, RadGrid3, RadGrid4) are properly registered in the RadAjaxManager settings. Make sure the AjaxControlID property of the AjaxSetting is set to the correct control ID of the RadGrid. Also, check if the UpdatedControls section includes all the necessary controls that should be updated after filtering.
  • Verify the RadGrid data source: Make sure that the data source for the RadGrid is properly configured and bound. Check the SelectMethod specified in the DataBinding section of the ClientSettings to ensure it returns the correct data.
  • Check the filter functionality: Review the JavaScript function Problem_NameComboIndexChanged1 that is triggered when the RadComboBox's selected index is changed. Ensure that it is correctly filtering the RadGrid based on the selected value. You can debug this function using browser developer tools and console.log statements to check if the correct filter value is passed to the RadGrid.
  • CSS or styling issues: It's possible that the filtered table is not visible due to CSS or styling conflicts. Verify if there are any CSS rules that might be affecting the visibility of the RadGrid or its elements. Inspect the HTML structure and CSS classes using browser developer tools to see if any conflicting styles are applied.

    By systematically checking these aspects and debugging the code, you should be able to identify the issue causing the disappearance of the RadGrid table after filtering.

No answers yet. Maybe you can help?

Tags
Ajax AjaxLoadingPanel AjaxPanel Filter Grid
Asked by
Rafi
Top achievements
Rank 1
Share this question
or