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

Mulitple questions on Use of Context Menu

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.

1 Reply

AD Administrator Syncfusion Team July 5, 2004 06:29 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon