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

Selected rows cols info

Hi,

I am wondering if there is an existing example or somebody can point a direction about how to achieve the following.

Basically, I want to show selected number of rows and cols like "5R x 6C" in a popup while user is selecting cells using mouse. similar to selection in excel, but the info is in a popup.

Thanks in advance.

Q

2 Replies

HA haneefm Syncfusion Team September 28, 2007 07:01 PM UTC

Hi Q,

One way you can do this by using the Model.SelectionChanging event of the grid and display selected cell information using the e.Range.Info property. Below are the codes that shows this task.

//Property of the Form1 class
private Label SelectedRangelabelText = null;

//Form Load event.
SelectedRangelabelText = new Label();
this.Controls.Add(SelectedRangelabelText);
this.gridControl1.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);

void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
Point pt = this.gridControl1.PointToClient(Control.MousePosition);
pt.Offset(35, 20);
SelectedRangelabelText.Location = pt;// e.OldRanges.ActiveRange;
SelectedRangelabelText.BringToFront();
if (e.Range != null)
{
SelectedRangelabelText.Text = e.Range.Info;
}
}

Best regards,
Haneef


QS Qingde Shi September 29, 2007 01:58 AM UTC

Haneef,

Thanks. That's very helpful.

Q

Loader.
Live Chat Icon For mobile
Up arrow icon