« emacs csharp mode setup | Main | DataGrid, AllowNew, Inhibiting display of append row »

Puzzling out DataGridColumnStyle for LinkLabel behavior

Using the SetDataGridInColumn method to install event handler on the DataGrid for MouseDown and Click events seems to work well.

Because the method gets called multiple times (once per row?) its necessary to avoid adding redundant handlers, they do get called redundantly.

Click events aren’t delivered to the handler for columns which use controls to edit values, the controls absorb all mouse events until the edit completes.

A column such as a LinkLabel column will need to remember the location of the last mousedown and then do a point resolution if a click event occurs. First verify in column, next determine row, finally determine which link, if any was clicked.

Note, using a real LinkLabel control doesn’t seem likely to work. In cell editing usage, a single control is mapped to the active edit cell. It doesn’t seem that a single control without the notion of a column of cells can be helpful to paint all of them and do event registration and delivery.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)