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.
Syncfusion Feedback

Selected rows cols info

Thread ID:

Created:

Updated:

Platform:

Replies:

68720 Sep 28,2007 03:24 PM UTC Sep 29,2007 01:58 AM UTC Windows Forms 2
loading
Tags: GridControl
Qingde Shi
Asked On September 28, 2007 03:24 PM UTC

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

haneefm [Syncfusion]
Replied On 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

Qingde Shi
Replied On September 29, 2007 01:58 AM UTC

Haneef,

Thanks. That's very helpful.

Q

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

;