We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

AllowNew in GridGrouping

If the AllowNew is set to true in the GGC a row appears in the browser that has an * and looks like it can be selected and data entered to create a new record.

I can not get this to work. If allow new is true how do I add a new record to the grid? I am using a LinqDataSource using SqlToLing and the Entity Framework.


2 Replies

TL Truman Lackey November 16, 2011 04:58 PM UTC

I have the AddNewRecord row working in that it is showing up and I can enter data.

Is there an example of getting the CRUD working with a linq data source? I'm kind of shooting in the dark not knowing what needs to be done.

Also can I get the AddNewRecord row always to appear at the end/start of the current page? With paging the AddNewRecord row either shows on the first/last page and not every page.



RR Ranjithkumar R G Syncfusion Team November 23, 2011 04:47 AM UTC

Hi Truman,

Thanks for using Syncfusion products.

Your requirement of using LINQ as datasource in GridGroupingControl can be achieved by PassThroughGrouping feature.When a grid is not bound to pass-through grouping by default, it will retrieve all the records in the bound data source to the client, even if only a few of them are displayed in the current view. This could become serious overhead when dealing with large data sources. To overcome this, instead of binding the grid to the data source directly, bind it to the LINQ query results. When you do so, data from your data source is retrieved on demand when a user requests it. Please refer to the below code snippet.

[ASPX]

runat="server" GridGroupingControlID="GridGroupingControl1"
SelectTable="Orders" SourceContext="DataClassesDataContext" >



Your requirement of showing add new record after details can be achieved by setting the property ShowAddNewRecordAfterDetails to true. Please refer to the code snippet below.


[ASPX]





Please refer to the below link to download the sample application.

http://www.syncfusion.com/downloads/Support/DirectTrac/86943/Passthroughgrouping171522482.zip


Please let me know if you have any concern.

Regards,
Ranjithkumar.




Loader.
Live Chat Icon For mobile
Up arrow icon