Home Forums WinForms controls Xceed Grid for WinForms CellEditorManager ActivatingControl Event

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14865 |

    Hi,

    I am new to this forum and Xceed components. One of the columns in my grid is a link. I followed the sample in the thread titled “Html Link in a grid”. It works great except that I want to turn of cell navigation because all of the grid data is read-only and I want entire rows to be selected. It appears that disabling cell navigation prevents the CellEditorManager ActivatingControl and DeactivatingControl events from being triggered. I need these events (or at least I think I do, according to the sample) in order to subscribe to the LinkClicked event of my custom CellEditorManager.

    Am I missing something, or are there other events I could use to subscribe and unsubscribe to the LinkClicked event?

    Lee

    Imported from legacy forums. Posted by Lee (had 2983 views)

    User (Old forums)
    Member
    Post count: 23064

    If you make your grid ReadOnly, none of the events related to editors will fire, since you never fall into edition, thus you never get to the editors.

    You will need to “mimic” the editor to do what you want, that is, subscribe to the cell click event (through the DataRowTemplate.Cells collection, before filling the grid with data, since this is a template), and in the Click event handler, simulate a click to the LinkLabel control (e.g. pop the browser and feed it the address).

    Imported from legacy forums. Posted by André (had 371 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry, I should have been more clear. The data is read-only but the link column is not. The following methods in my LinkEditorManager are being called correctly:

    – CreateControl
    – SetControlValueCore
    – CalculateEditorBoundsCore
    – SetControlAppearanceCore

    But ActivateControlCore is never called and the ActivatingControl event is never triggered. Apart from that, it all works great. The linklabel appears and the link underline appears when the mouse hovers over the cell. I just need to hook up the LinkClicked event and I am all set.

    Lee

    Imported from legacy forums. Posted by Lee (had 445 views)

    User (Old forums)
    Member
    Post count: 23064

    I have gotten it to work for now by subscribing to the LinkLabel.LinkClicked event in the LinkEditorManager.CreateControl method and unsubscribing in the LinkLabel.Dispose event. Let me know if you think there is a more elegant or efficient way to do this.

    Thanks,

    Lee

    Imported from legacy forums. Posted by Lee (had 3906 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.