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

How to have different context menus attached to parent grid and chid grid

Thread ID:

Created:

Updated:

Platform:

Replies:

79617 Feb 17,2009 08:06 PM UTC Feb 25,2009 01:48 PM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On February 17, 2009 08:06 PM UTC

Hi ,

I am looking into how to provide different context menus on the parent grid and the child grid.Can you please point me on how this can be done and whether there is any sample code that i can look into.

Can you please advise.

thanks
-Gurtaran


Rekha P [Syncfusion]
Replied On February 18, 2009 01:38 PM UTC

Hi Gurtaran,

Thank you for your interest in Syncfusion Products.

We regret to let you know that we do not provide support to show different context menus for parent table and child table. As a workaround, you can check and iterate through table row ids and enable the context menu.

http://websamples.syncfusion.com/samples/Grid.Web/7.1.0.21/F79617/ContextMenu_Sample.zip

Please let us know if you have any concerns.

Thanks,
Rekha


Administrator [Syncfusion]
Replied On February 18, 2009 03:12 PM UTC

Thanks Rekha,

I'll try this one.
another question that i had was how in general i can have my events apply to child grids also.Say eg if i want the selected records changed event to work for child grids also.
Can you please advise on this too.

Thanks
-Gurtaran

>Hi Gurtaran,

Thank you for your interest in Syncfusion Products.

We regret to let you know that we do not provide support to show different context menus for parent table and child table. As a workaround, you can check and iterate through table row ids and enable the context menu.

http://websamples.syncfusion.com/samples/Grid.Web/7.1.0.21/F79617/ContextMenu_Sample.zip

Please let us know if you have any concerns.

Thanks,
Rekha




Rekha P [Syncfusion]
Replied On February 20, 2009 03:32 AM UTC

Hi Gurtaran,

Please refer the Code snippet below to trigger SelectedRecordsChanged event for child tables.

[C#]


GridRelationDescriptor parentToChildRelationDescriptor;

protected void Page_Load(object sender, EventArgs e)
{
if (! IsPostBack)
{
// Manually specify relations in grouping engine. The DataSet does not need to have any DataRelations.
// This is the same approach that should be used if you want to set up relation ships
// between independent IList.
parentToChildRelationDescriptor = new GridRelationDescriptor(); //Child Table
parentToChildRelationDescriptor.ChildTableName = "MyChildTable"; // same as SourceListSetEntry.Name for childTable (see below)
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add("parentID", "ParentID");
}
parentToChildRelationDescriptor.ChildTableDescriptor.SelectedRecordsChanged += new SelectedRecordsChangedEventHandler(ChildTableDescriptor_SelectedRecordsChanged);
}

void ChildTableDescriptor_SelectedRecordsChanged(object sender, SelectedRecordsChangedEventArgs e)
{
//your code
}



Please let me know this code snippet helps you.

Thanks,
Rekha




Administrator [Syncfusion]
Replied On February 24, 2009 06:34 PM UTC

Hi Rekha,

Many thanks for the above.
On my first question - I am still a bit confused on the workaround that i can use to get this different context menu working.Can you please elaborate on this , or probably can you please post some code as part of reply to this( as i was not sure which part of the sample code i could use in the sample that you pointed previously )


Thanks again.
Gurtaran


>Hi ,

I am looking into how to provide different context menus on the parent grid and the child grid.Can you please point me on how this can be done and whether there is any sample code that i can look into.

Can you please advise.

thanks
-Gurtaran




Rekha P [Syncfusion]
Replied On February 25, 2009 01:48 PM UTC

Hi Gurtaran,

We regret to let you know that it is not possible to show different context menus for parent table and child table. Because the ContextMenu is designed to show for a GridGroupingControl parent table id and also the child table ids are generated dynamically with random numbers, hence we cannot able to show different context menus for parent table and child table.

We regret for the inconvenienced caused and please let us know if you have any concerns.

Thanks,
Rekha


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

;