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

Grid - Excel-like Filtering not work in .ascx

11 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mostafa
Top achievements
Rank 1
Mostafa asked on 07 Oct 2015, 11:27 AM

Hi,
RadGrid  Grid - Excel-like Filtering not work in .ascx page... but it work in .aspx.
In .ascx page when i click on the Header Context Filter Menu button the Filter Popup is not show .... nothing is happen but in .aspx page it works well

would you please help me so that Excel-like Filtering  is also work on a grid that is in my .aspx page 

 Here is my grid code Mostly taken from your example 

//////////////////

<telerik:RadGrid ID="grdBracketPlayers" Width="1120" runat="server" Skin="Metro"  
                                AllowFilteringByColumn="true"  FilterType="HeaderContext" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" AllowPaging="True" OnFilterCheckListItemsRequested="grdBracketPlayers_FilterCheckListItemsRequested"  AllowSorting="true" GroupingEnabled="true"
                                OnNeedDataSource="grdBracketPlayers_NeedDataSource"> 
                                <MasterTableView DataKeyNames="FullName" AutoGenerateColumns="False" >
                                    <Columns>
                                        
                                       <telerik:GridBoundColumn FilterCheckListEnableLoadOnDemand="true" DataField="FullName" FilterControlAltText="Filter ContactName column" HeaderText="PlayLevelName" SortExpression="PlayLevelName" UniqueName="PlayLevelName" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith">
                        </telerik:GridBoundColumn>
                                    
                                    </Columns>
                                </MasterTableView>
                                
                            </telerik:RadGrid>​

11 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Oct 2015, 01:19 PM
Hi,

Thank you for contacting us.

I tried to replicate the described problem in simple runnable project and excel-like filtering is working properly when the grid is inside .ascx page. Find attached my test page and let me know what is the difference in your case.

Additionally, check the browser console for errors when you click context menu button. Javascript error on the page could prevent the menu from opening.

I hope this helps.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Robert
Top achievements
Rank 1
answered on 09 Oct 2015, 11:30 AM

Mostafa --

Perhaps this is the source of your problems. This is the response I received back from Telerik with the same problem.

From Telerik Tech Support --------------------------------------- 

"Indeed in the described scenario excel-like filtering would not work. For the time being, you could try binding the ListBox inside the filter menu with Web Services. You could take a look at the blog post "Add Excel-like Multi-select Filtering to Your ASP.NET DataGrid" for more information about the suggested approach.

Another option would be to create the grid declaratively as it is done in the project I sent you. Please excuse us for the inconvenience caused.

-------------------------------------------------------------------

 So we are back to this again. I cannot believe they even bothered releasing this. It is just marketing fluff.

 

0
Mostafa
Top achievements
Rank 1
answered on 09 Oct 2015, 12:26 PM

Hi Pavlina
i try that but its not work for me.In my page i need to rebind the radgrid from server.After Rebind the grid from sever side my grid is shown but when i click on the header button for "excel-like filter" nothing is happen ... no popup is open.
the sample project that you send to me if you rebind the grid in page prerender even then it no open the filter popup 
Please use the same project that you send me and just add the following code in your WebUserControl.ascx.cs file .. you can easily find the problem that filter is not work 

 

/////////////////////

 protected void Page_PreRender(object sender, EventArgs e)
    {
        RadGrid1.Rebind();
    }

0
Pavlina
Telerik team
answered on 09 Oct 2015, 04:58 PM
Hi,

Note that in order to enable LoadOnDemand of the checklist you should Rebind() the grid on PageLoad. This is so because control events and RaiseCallbackEvent (ListBox method) are called before PreRender. This means that in order event to be raised and listbox to populate with data the control should be rendered on the page at this point. More information for the page lifecycle is available here:
https://msdn.microsoft.com/en-us/library/ms178472.aspx
 
Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mostafa
Top achievements
Rank 1
answered on 12 Oct 2015, 08:18 AM

Hi Pavlina,

well i was use Checklist Filter i mean Filter type ="CheckList" and rebind my Radgrid in Page_PreRender event and that filter works well .... but new  Excel-like Filtering is not work why i think it is a bug. if you use the same code that you sand me and change the filter type to "Checklist" Filter and rebind the grid in Page_PreRender  . then it work well you see your checklist ..... but "Excel-like Filtering" not work why .. is not it is a Bug .. because if Checklist Filter is work After Rebind the Grid In Page_PreRender  Event then Excel-like Filtering also should be work after Rebind Grid In Page_PreRender Event 
.. not only me Most of people Rebind their Grid in Page_PreRender Event when they use MultiView...

so please take a look on this thing and give me a solution so that i can use Excel-like Filtering after rebind the grid in Page_PreRender  Event 

0
Pavlina
Telerik team
answered on 13 Oct 2015, 02:00 PM
Hello,

The behavior is different because the ListBox in the case with Excel-like filtering is placed in HeaderContextMenu which needs to be rendered earlier than the filter menu due to the other composite controls placed in it. However, I forwarded your concerns to our developers and they will do their best to unify different  filter type behavior.

Please excuse us for the inconvenience caused.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kasim
Top achievements
Rank 2
answered on 19 Jun 2018, 05:37 AM
I am facing the same problem with the latest version of the control. The filtering is working good with the ASPX page but when it goes to .ascx, it stops working. Kindly help.
0
Mostafa
Top achievements
Rank 1
answered on 20 Jun 2018, 07:51 AM
In .ascx when you post back it rebind the grid so you lost your filter settings ......... i solve my problem by doing some customization in different grid event ....
0
Kasim
Top achievements
Rank 2
answered on 20 Jun 2018, 08:27 AM
Which grid event you handled to workaround the issue? Could you please provide some details along with code snippet?
0
Kasim
Top achievements
Rank 2
answered on 05 Aug 2018, 09:15 AM
Is there no fix available for the issue till now? This is really weird.
0
Tsvetomir
Telerik team
answered on 08 Aug 2018, 12:04 PM
Hi Kasim,

I've already responded to your query in the support thread about the same matter. I suggest that we continue our technical conversation on the mentioned thread.

Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Mostafa
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Robert
Top achievements
Rank 1
Mostafa
Top achievements
Rank 1
Kasim
Top achievements
Rank 2
Mostafa
Top achievements
Rank 1
Tsvetomir
Telerik team
Share this question
or