How to get the position of the activeCell

Posted by: roger_wang on 10 September 2017, 10:58 am EST

  • Posted 10 September 2017, 10:58 am EST

    i want to get the ActiveCell postion, but fail.
    for example: gcSpreadSheet1.GetPostionByCell(row, col)??

    now, i just use the mousedown envent:
    void gcSpread1_MouseDown(object sender, MouseButtonEventArgs e)

    {

    HitTestInformation info = gcSpreadSheet1.HitTest(e.GetPosition(gcSpreadSheet1).X, e.GetPosition(gcSpreadSheet1).Y);

    if (info.HitTestType == HitTestType.Corner)

    gcSpreadSheet1.Sheets [0].SetText (0,0,"Click SheetCorner of control");

    if (info.HeaderInfo != null)

    {

    if (info.HeaderInfo.InColumnResize)

    gcSpreadSheet1.Sheets[0].SetText(0, 0, "Column" + info.HeaderInfo.Column.ToString() + " is resizing");

    else if (info.HeaderInfo.InRowResize)

    gcSpreadSheet1.Sheets[0].SetText(0, 0, "Row" + info.HeaderInfo.Row.ToString() + " is resizing");

    }

    }

  • Marked as Answer

    Replied 10 September 2017, 10:58 am EST

    Hello,

    You should be able to get cell position on MouseDown event using

    e.GetPosition(gcSpreadSheet1).X , e.GetPosition(gcSpreadSheet1).Y


    There is no direct method to get the cell position with Spread for Silverlight.

    Thanks,
    Deepak Sharma
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels