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

Getting started with this whole data and grid thing

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MArkB
Top achievements
Rank 1
MArkB asked on 10 Dec 2012, 08:18 PM
Hopefully you wont take this as a "Please send me the codez" type post though I'm sure it's going to kind of look like one.

It's a simple application. Search for and select a patient. Show a bunch of bits of information about that patient. On a couple of the tabs show the many events that have happened to those patients. Operations for example.

I was given a skeleton of an application to work with that didn't have much on it besides some basic HTML data controls, a Telerik tab control with paging.

What I'd like help with is the big picture basic architecture of how to put that together using Telerik controls.

I'm using the Entity Framework for the Data Layer and I have that connected to the Operations grid in code.
Like this:
this.EntityDataSource2.WhereParameters.Clear();
this.EntityDataSource2.AutoGenerateWhereClause = true;
this.EntityDataSource2.WhereParameters.Add("PATIENT_ID", TypeCode.Int32, ddlSearchSSN.SelectedValue);
 
this.gridOperations.DataSource = EntityDataSource2;
this.gridOperations.DataBind();

So I fill up a combo box, pick the patient SSN from that combo box, populate all the HTML controls vie code and then filter and bind the grid for showing operations. All that is working (for read) but I think there has to be a better way.

Something like a parent control for the operations Grid that I can put all the HTML controls in. You know, like a Parent-Child grid relationship where the parent shows only one record that I can bind to a datasource.

Thanks,

MArk (Plz send hte codez) B.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 13 Dec 2012, 02:51 PM
Hello Mark,

I have to say that I'm not sure that I completely understand your scenario. If I'm not missing something, a possible approach could be to setup a hierarchical grid. You can create a template column in the first level and put the aforementioned HTML controls in its item template.
If you want more control over the parent-child relations you can bind RadGrid using advanced data-binding (directly to the ef context) by taking advantage of the NeedDataSource and DetailTableDataBind events.
Advanced Data-binding (using NeedDataSource event)
Hierarchical data-binding using DetailTableDataBind event

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
MArkB
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or