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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding new row

Thread ID:

Created:

Updated:

Platform:

Replies:

56241 Feb 12,2007 02:54 PM UTC Feb 12,2007 05:57 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 12, 2007 02:54 PM UTC

Hi,

Will you please tell me how to add a new row in GridGroupingControl programatically without creating a new row in underlying datasource.

Cheers,
Vinod

Administrator [Syncfusion]
Replied On February 12, 2007 03:26 PM UTC

Hi Vinod,

You can use the AddNewRecord property of the GridTable to add new record in a grid. Please try the below code snippet and let me know if this helps.

this.gridGroupingControl1.Table.AddNewRecord.SetCurrent();
this.gridGroupingControl1.Table.AddNewRecord.BeginEdit();
this.gridGroupingControl1.Table.CurrentRecord.SetValue("ColumnName","Value");
this.gridGroupingControl1.Table.AddNewRecord.EndEdit();

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 12, 2007 05:57 PM UTC

Hi Haneef,

Sorry but this is not as per my requirement. Because it adds a new record in underlying datasource and then SetValue() method tries to save values in fields of newly created row in underlying datasource.

My requirement in detail:
-----------------------------
I am using GridGrouping control for displaying Hierarchical data. But I don't want to display standard plus/minus buttons for expanding and collapsing child record.
The datasource is EntityCollection which contains the collection of Department entities. Each Department entity contains collection of SubDepartment entities.

Department Entity:
-----------------
DeptNo int,
DepartmentDescription string

SubDepartment Entity:
-----------------
SubDeptNo int,
SubDepartmentDescription string

I want to show the columns (in unbopund mode) for all the fields from both (Department and SubDepartment) entities at parent (Department) level.
If a department has only one Subdepartment then there will be only one record in grid.
If a department has two Subdepartments then there will be three records in grid.
First record will list only Department details and cells for subdepartment will be blank
Second and Third records will list SubDepartment details and cells for Department will be blank.

For achieving this I was thinking, I will add new records in grid if child collection contains more than one entity and this action will not create new entities in underlying EntityCollection. These new records should map to Child Collection.

Will you please explain how it can be achieved?

Cheers,
Vinod

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;