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

RadGrid and Linq - How To Get Code Behind Working

1 Answer 148 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Alan Scott
Top achievements
Rank 1
Alan Scott asked on 21 Jul 2009, 08:57 PM
I have a nice presentation form that displays all the data within a table automatically (easily done with the component). However, now I want to be able for users to query the database table and click the query button and have the table updated.

Below is the code I am using:

EAIDataClassesDataContext db = new EAIDataClassesDataContext();
            var hl7dTypes = from p in db.REF_HL7_DATATYPEs where p.DATATYPE.Contains(RadTextBox1.Text.Trim()) select p;
            //LinqDataSource.Equals == hl7dTypes;
            //LinqDataSource.DataBind();
            //RadGrid1.DataSource = hl7dTypes;
            //RadGrid1.DataBind();
            RadGrid1.Rebind();

As you can tell I have tried the commented out options and all either do not work or cause a page rendering error. How can I get this to work?

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 22 Jul 2009, 08:11 AM
Hello Alan,

I think that the information from the following online resources will help you use LINQ queries from the code-behind to bind your grid instance to data:

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/programaticlinqupdates/defaultcs.aspx
http://www.telerik.com/help/aspnet-ajax/grdlinqtosqlmanualcrudoperations.html

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Alan Scott
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or