- Home
- Forum
- ASP.NET Core - EJ 2
- Filter Menu Operation and DatamanagerRequest
Filter Menu Operation and DatamanagerRequest
I do no understand what is going on with the datagrid and filter menu. For a string, it sends a request via the URL adapter with no select property, and just a simple where object. If I go filter on a boolean column it sends a select object but no where object.
For instance, if I'm trying to filter by name on the Name column, wouldnt it make sense for the
DataManagerRequest object to have a select object with field Name in it, so we can return just names to fill the autocomplete box? And why is the boolean column sending it but not string?
Hi IceCactus,
Greetings from Syncfusion support
By default, the AutoComplete component is used in the Filter Menu for string columns. It sends a "where" query request to the server with each keystroke, and when the filter button is clicked, the full value is sent along with the “where” query request.
Similarly, for Boolean columns, the DropDownList component is used by default in the Filter Menu. It sends a select query to the server when the dropdown popup opens, and upon clicking the filter button, the selected Boolean value is sent with the “where” query request.
These requests are generated based on the native behavior of the respective components in the Filter menu. For your convenience, we have demonstrated the setup we used. Please refer the below sample and video demo for more information.
Sample: Check the attachment.
Video demo: Check the attachment.
If you still face any issue with the string and Boolean column request, please share the below details
1) Share the issue scenario step by step with detailed description along the video demonstration.
2) Share your complete Grid rendering code, we would like to check your Grid initialization settings and implemented features.
3) Share any issue reproducible sample or try to reproduce the issue with our shared sample that would be helpful for us to validation and provide better solution.
Regards,
Rajapandi R
Attachment: 196126_23589da5.zip
Thanks for the example and the help!
Is there a way to make it so boolean columns don't need to send a select request to get filter values? i can just use 0 or 1 on the client side? Seems like a waste on every boolean column to do a postback to the server just to get 0 or 1 values
Hi ,
Based on your query, we understand that you want to prevent the grid from sending a request to the server when opening the filter menu dropdown for a boolean column. To achieve this, you can provide a custom dataSource to the dropdown component of the filterMenu by configuring the column.filter property in the grid. This ensures that the dropdown list is populated locally instead of fetching data from the server.
The code snippet has been attached for your reference,
|
@{ ViewBag.DropDownData = new List<object> { new { verified = true}, new { verified = false }, }; }
<e-grid-column field="verified" type="boolean" displayAsCheckBox="true" headerText="Verified" filter="@(new { @params = new Syncfusion.EJ2.DropDowns.DropDownList() { DataSource = ViewBag.DropDownData }})" width="140">
|
Please get back to us for further assistance.
Regards,
Dineshnarasimman M
Attachment: FilterMenuDropDown_96cb34d0.zip
This works great. Thank you
Hi,
Thanks for the update. Please let us know if you need any further assistance.
Regards,
Dineshnarasimman M
- 5 Replies
- 3 Participants
-
IC IceCactus
- Feb 16, 2025 10:16 PM UTC
- Feb 24, 2025 11:39 AM UTC