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

Zip code search by radius and price

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 08 Mar 2018, 06:22 PM

I have a readgrid with a list of USA addresses.

 

I want to be able to enter in a city, state or zip code and have it show me the list with what is closest first to what was entered.

What API would I want to connect with?  

 

Also, has anybody had any experience with taking this one step further and not just look at what is closest but factor in other items like price example.

 

Facility A is 10 miles away and our cost is $50

Facility B is 11 miles away and our cost is $40

 

Even thought A is closed I want B to show first since its only 1 mile away but we will save $10 by telling the person searching this is the first pick.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Mar 2018, 08:53 AM
Hi,

I can suggest you start from the following demo that shows how you can filter the grid data source based on an external control. It uses a combo box and a declarative SqlDataSource with a ControlParameter. Link: https://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridcomboajax/defaultcs.aspx?product=combobox&show-source=true.

Alternatively, you can provide data to the grid in its NeedDataSource event which can be triggered by a call to its .Rebind() method. This, in turn, can be called by an event like TextChanged of the input textbox. This will let you execute any logic you need in order to provide the desired grid data source. You can read more about using the NeedDataSource event here: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-binding/understanding-data-binding/server-side-binding/advanced-data-binding-(using-needdatasource-event).


Regards,
Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or