Filtering with custom column in Grid

Good day !

  I'm testing SF Grid for a real-time dashboard. One of the column is a simple custom control (let's name it "PriceControl")  that get a model as input param and displaying only a span label with decimal value, and this control has subscription to external event and it updates its decimal value each second.

  All is working fine so far, but now I want to make a custom filter for this column: a checkbox that filter records where Price > 100.
   I'm not sure I can use FilterTemplate for a GridColumn without Field (since it's a template with child control inside). And also I didn't find a proper way to make a ref or some binding to "PriceControl" so I can use its value in the filter (each row in Grid has its own model and its own Price).
  Is there any workaround for such scenario ?

Best regards,
Vadim.


3 Replies

RN Rahul Narayanasamy Syncfusion Team September 27, 2021 01:33 PM UTC

Hi Vadim, 

Greetings from Syncfusion. 

We have validated your query with the provided details. You have rendered a custom column(Custom control which shows some custom values) and you don’t have Field for that custom column. We would like to inform you that the Grid operations(such as Filtering, sorting, etc) works based on the Field property defined in the GridColumn. So we need to define Field property to perform Grid operations. 

If we don’t provide Field property to GridColumn, then we could not able to perform Grid operations(Filtering, Sorting, etc).  

Please let us know if you have any concerns. 

Regards, 
Rahul 



VH Vadim Helmovskiy October 8, 2021 07:57 AM UTC

Hi Rahul!

 OK. So it's limited only with Grid pre-defined fields. I'll try then to implement it in another way with Observable collection, where I gonna modify the calculated column to get the same effect as current PriceControl does.
 
  For now I have another question related to a bug.
When I use built-in "Search" for Grid, it always loads the initial state of PriceControl and ignore the current state of it. It's definitely not the expected behavior. The "Search" function should only affect the visual part and just filter out the records, isn't it?

Best regards,
Vadim.



RN Rahul Narayanasamy Syncfusion Team October 12, 2021 03:27 AM UTC

Hi Vadim, 

Thanks for the update. 

We have validate your query and we need more details regarding the reported problem. Could you please share the below details. It will be helpful to validate and provide a better solution. 

  • Full grid code snippets.
  • Share a simple reproduceable sample if possible.
  • Video demonstration of the problem.
  • Share the details about how you are updating the values.

Regards, 
Rahul 


Loader.
Up arrow icon