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.
Unfortunately, activation email could not send to your email. Please try again.

Creating a standalone DataRowView

Thread ID:

Created:

Updated:

Platform:

Replies:

69541 Oct 31,2007 03:13 PM Nov 1,2007 03:04 PM Windows Forms 3
loading
Tags: GridControl
Stephane Dapsanse
Asked On October 31, 2007 03:13 PM

Hi,

I would like to create an empty DataRowView object that has the same columns as a GridDataBoundGrid. I do not want to use AddNew as I do not want the object to be added right away to the GridDataBoundGrid.

J.Nagarajan [Syncfusion]
Replied On October 31, 2007 08:10 PM

Hi Stephane ,

You can disable the AddNewRow by setting false to gridDataBoundGrid1.EnableAddNew property. You can use the following code snippet to have a empty data grid view.

[C#]

CurrencyManager cm = (CurrencyManager)this.gridDataBoundGrid1.BindingContext[gridDataBoundGrid1.DataSource, gridDataBoundGrid1.DataMember];
DataView dv = cm.List as DataView;
dv.Table.Rows.Add(new object[] { });


Please let me know if this helps

Regards,
Nagaraj

Stephane Dapsanse
Replied On November 1, 2007 09:43 AM

Hi Nagaraj,

Correct me if I am wrong but:
DataView dv = cm.List as DataView
dv.Table.Rows.Add(new object[] { });
will add a row to to the dataview.

I need to get a standalone DataRowView that has the same colllectio of columns as the dataview. I need something like:
DataRowView drv = dv.Table.NewRowView();

Is it possible?
Thanks,
Stephane

haneefm [Syncfusion]
Replied On November 1, 2007 03:04 PM

Hi Stephane,

Please try these code and let me know if this helps.

CurrencyManager cm = this.BindingContext[this.gridGroupingControl1.DataSource] as CurrencyManager;
DataView dv = cm.List as DataView;
DataRowView drv = dv.AddNew();

Best regards,
Haneef


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.

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.

;