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.

Mulitple questions on Use of Context Menu

Thread ID:

Created:

Updated:

Platform:

Replies:

16047 Jul 4,2004 10:58 PM Jul 5,2004 02:29 AM Windows Forms 1
loading
Tags: GridControl
arvind
Asked On July 4, 2004 10:58 PM

Hai, I have several questions on the use of Context Menu on GridDataBoundGrid.They are, 1.How can i select multiple rows with the help of context menu and Control Key. 2.How can i delete the selected multiple rows with the button click event . Regards, Hsee.

Administrator [Syncfusion]
Replied On July 5, 2004 02:29 AM

1) Try setting grid.ListBoxSelectionMode = SelectionMode.MultiSelect. This should allow your user to use the keyboard and mouse to select multiple rows. I am not sure what you mean by selecting rows with your context menu. Are you going to have a menu iten that says "Select rows 1-3"? If so, you can use grid.Selections.Add(GridRangeInfo.Rows(1,3)) to do this. 2) One way you can do this is to use SendKeys and forward a Delete key onto the grid from your button handler.
private void button1_Click(object sender, System.EventArgs e)
{
	this.gridDataBoundGrid1.Focus();
	SendKeys.Send("{DELETE}");
}
One comment is that the grid only deletes the active range. If you have several disjoint selections, the grid by default only deletes the active one. If you want to delete all on them, then you can try the technique in this KB. http://www.syncfusion.com/Support/article.aspx?id=10443

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.

;