The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi, I am using gridgrouping control. I am trying to simulate copy functionality in the grid, but not exactly a copy paste. I am using custom entities to bind the solution. The catch here is that the custom entity is having another entity as a property, so the entity is not pretty flat. Now when I say copy, I want that certain values should be excluded in the copied data.
product entity
public class product { private int id; public int Id { get { return id; } set { id = value; } } private string type; public string Type { get { return type; } set { type = value; } } Dictionary _productFeatures; public Dictionary ProductFeatures { get { return _productFeatures; } set { _productFeatures = value; } } }
feature entity
public class feature { private int featureId; public int FeatureId { get { return featureId; } set { featureId = value; } } private int featureDescription; public int FeatureDescription { get { return featureDescription; } set { featureDescription = value; } } }
In the example above, product is having a collection of ProductFeatures and I am binding a collection of product entities to grid. Now when I select a product on grid and click on a button which invokes copy, I want a new record to be inserted into the grid except the product id(which I am getting from Data base).
The follwing code works fine if I have to just copy the product, had it been a flat entity
newID = GetNewIDFromDB() this.dgRangePlanGrid.Table.AddNewRecord.SetCurrent(); this.dgRangePlanGrid.Table.AddNewRecord.BeginEdit(); this.dgRangePlanGrid.Table.CurrentRecord.SetValue("id", newID); this.dgRangePlanGrid.Table.AddNewRecord.EndEdit();
what do I do when product is having a collection inside?
ADAdministrator Syncfusion Team February 13, 2007 08:04 PM UTC
Hi Dinesh,
This can be achieved by using the TableModel.ClipboardCopy add the information you want to the clipboard and then handle TableModel.ClipboardPaste and retrieve your clibboard object and use it. Here is a forum thread discuss with the simillar issue.
Let me make my problem more clear. The copy functionality I am looking for is not the copy pase in classical sense. I select a row, click on a button "Copy", and the selected row gets added in the grid, without the user invoking any paste. The copied data doesnot goes into the clipboard as i am not doing any ctrl+c.
Another quey is that after the data has been bound to a grid, if there are any changes in the underlying data source by some other process, how to get those changes reflected in the Grid?
Thanks
ADAdministrator Syncfusion Team February 14, 2007 05:03 PM UTC
hi,
Let me make my problem more clear. The copy functionality I am looking for is not the copy pase in classical sense. I select a row, click on a button "Copy", and the selected row gets added in the grid, without the user invoking any paste. The copied data doesnot goes into the clipboard as i am not doing any ctrl+c.
Another quey is that after the data has been bound to a grid, if there are any changes in the underlying data source by some other process, how to get those changes reflected in the Grid?