- Home
- Forum
- LightSwitch HTML
- Problems with binding data to Range Navigator
Problems with binding data to Range Navigator
I've run into a problem with feeding data from a sql database to the Range Navigator. I've tried two approaches, and have not found a solution for how to populate this control.



Approach #1 : Ajax call from aspx page to function in code behind page that populates a datatable with sql data, and returns JSON string in the format / structure given in the online documentation example. Problem: decoding JSON leaves sql datatime as a string, but I believe the control expects it to be date data type.

Approach #2 : Bind the range navigator control to the data from code behind. Using the same data structure as before, but instead of converting the data object to JSON, I conver it to a list so it can be cast to IEnumerable. I then bind this to the control. When I attempt to run the page, it takes forever, and finally throws an exception (something about null color attribute?)


How can I get data from sql bound to this control, using one of the approaches I've tried, or something else?
SIGN IN To post a reply.
4 Replies
VA
Vinothkumar Arumugam
Syncfusion Team
May 14, 2015 01:14 PM UTC
Hi Megan Brown,
Thanks for using Syncfusion products.
We have analyzed your reported query and found that the images attached in the forum are not uploaded properly and we are not able to view them, so we find difficulty in understanding your way of binding datasource to rangenavigator. However we have prepared a simple sample by using NORTHWNDEntitiesData as a primary database file and connected rangenavigator. In which we are using Orders table to render chart.
Please find below sample and you can download it from below link
Sample Link:
Sample.zip
If this is not your requirements please revert us back by modifying the sample, it will help us to serve you better.
Thanks,
Vinothkumar Arumugam
MB
megan brown
May 14, 2015 02:26 PM UTC
strange, I can see the images. i'll take a look at the sample you provided and get back with you.
in the meantime, I'm attaching the images instead of linking them.
image 1: screenshot of json structure from "approach 1", showing sql date as string data type.
image 2: screenshot of c# used to structure the sql data and bind to the range navigator control (approach #2)
image 3: class structure used in image 2 above.
Attachment: images_740bac52.zip
MB
megan brown
May 14, 2015 09:25 PM UTC
I've also added a fourth image, which shows the crash error I see when I attempt to run my code.
Attachment: image_4_2250220b.zip
Attachment: image_4_2250220b.zip
AB
Akbar Basha K M
Syncfusion Team
May 15, 2015 01:21 PM UTC
Hi Megan Brown,
As you have already created the same incident in the forum we have updated the response inincident(139097) .we kindly request you tofollowup the same in this regard.
Thanks,
Akbar Basha KM.
As you have already created the same incident in the forum we have updated the response inincident(139097) .we kindly request you tofollowup the same in this regard.
Thanks,
Akbar Basha KM.
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
MB megan brown
- May 13, 2015 04:31 PM UTC
- May 15, 2015 01:21 PM UTC