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
close icon

create dynamically a linkButton Column

http://,,,,

4 Replies

JO jone May 10, 2012 10:37 AM UTC

Hello,

I have a GridGrouping Control.

my grid is created in the markup code.

but the child grid is created dynamically.

how can i make one of the columns to be a linkButton column?

and which event is there when i click one link (one cell)?

 

thanks in advance

waiting for an answer, jone

 



JP Jeya Preetha M Syncfusion Team May 15, 2012 11:14 AM UTC

Hi Jone,

Thanks for your interest in Syncfusion products.

Please refer the following code which explains parent child relation with two table. Make use of this code in your application accordingly.

<code>

DataTable parentTable = GetParentTable();

DataTable childTable = GetChildTable();

DataTable grandChildTable = GetGrandChildTable();

// Manually specify relations in grouping engine. The DataSet does not need to have any DataRelations.

GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();

parentToChildRelationDescriptor.ChildTableName = "MyChildTable"; parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;

parentToChildRelationDescriptor.RelationKeys.Add("parentID", "ParentID");

// Add relation to ParentTable

gridGroupingControl1.TableDescriptor.Relations.Add(parentToChildRelationDescriptor);

GridRelationDescriptor childToGrandChildRelationDescriptor = new GridRelationDescriptor();

childToGrandChildRelationDescriptor.ChildTableName = "MyGrandChildTable"; childToGrandChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;

childToGrandChildRelationDescriptor.RelationKeys.Add("childID", "ChildID");

// Add relation to ChildTable

parentToChildRelationDescriptor.ChildTableDescriptor.Relations.Add(childToGrandChildRelationDescriptor);

// Register any DataTable/IList with SourceListSet, so that RelationDescriptor can resolve the name

this.gridGroupingControl1.Engine.SourceListSet.Add("MyParentTable", parentTable);

this.gridGroupingControl1.Engine.SourceListSet.Add("MyChildTable", childTable);

this.gridGroupingControl1.Engine.SourceListSet.Add("MyGrandChildTable", grandChildTable);

this.gridGroupingControl1.DataSource = parentTable;

Please let me know if this helps you.

Regards,
Jeya Preetha M



JO jone September 11, 2012 07:31 AM UTC

hello,

thank you for your answer.

that is what i did, and it works,

but i cant make a column to be a link.

how can do that?



KB Kalaiarasan B Syncfusion Team September 11, 2012 12:30 PM UTC

Hi Jone,

By default you can’t set a celltype for GridGroupingControl as LinkLabel, but you can achieve it by creating a custom renderer and assign it to the Grid.

Please make use the custom renderer in the below link and include it in the Grid’s CellModels and assign it as celltype for the columns.

 

http://www.syncfusion.com/downloads/Support/DirectTrac/98078/LinkLabelCell-1466590518.zip

Here is the code to assign the custom cell as celltype for a specific column

this.gridGroupingControl1.TableModel.CellModels.Add("LinkLabel",new LinkLabelCellModel(this.gridGroupingControl1.TableModel));

this.gridGroupingControl1.TableDescriptor.Columns[Column name].Appearance.AnyRecordFieldCell.CellType = "LinkLabel";

Please let me know if you have any concerns

Regards,

Kalai


Loader.
Live Chat Icon For mobile
Up arrow icon