Database example

3 posts, 0 answers
  1. Anthony
    Anthony avatar
    13 posts
    Member since:
    Aug 2014

    Posted 17 Aug 2014 Link to this post

    I'm having a hard time finding an example of a gridview pulling data from a database. I've looked through the SDK, documentation, and google results for hours to no avail. This really should be easier to find as it has to be a very common request. While I'm at it, there should definitely be an example of this in the SDK (if it's already there, it's not obvious).

    I want to do something that should be really easy:
    1) Use a datagrid to view rows in a database
    2) add/modify rows using buttons and another window
    3) filter and sort

    I found this overview to help explain what should happen, but I have no idea how to actually implement it:

    I don't fully understand all the differences between MVVM, code behind, etc., but the key statement from the link that I want to implement is this: "All operations such as paging, filtering, sorting, and grouping will automatically happen on the server without a single line of code." I'm guessing insert and update operations will require some code, but maybe not.

    I have entity 6.1.x, telerik SDK, and an mssql database with example data already setup. I also have a project based on an example in the SDK that compiles and runs with no issues. All of the pieces should be in place, but I'm missing the critical component that explains how to transact data with entity/databases/whatever it's called.
  2. Anthony
    Anthony avatar
    13 posts
    Member since:
    Aug 2014

    Posted 17 Aug 2014 in reply to Anthony Link to this post

    Also, I've followed this example, but the end result doesn't compile:

    I couldn't find a completed solution for that and the code I copied exactly won't compile. I can probably use that tutorial to help with what I want to do, but I need to figure out the database component first. After data is pulled from a mssql database through entity, then I can worry about inserts, updates, etc. unless there's a way to handle all of it at once.

    Here's a link to my project:

    The GetReports function is working, but that's obviously not how I want to get the data. In the database scripts folder, there are a few scripts that will build a close enough approximation of my real database for this example.
  3. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 18 Aug 2014 Link to this post


    You can check the "Various Data Sources" SDK example. Basically, the approach for populating data from the server is the same as with MS DataGrid control or any other items control. There is nothing specifically related to RadGridView. 
    As to the data operations, they will work similarly no matter if your data is in memory or not. 

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top