|
Infralution Support Support groups for Infralution products
|
View previous topic :: View next topic |
Author |
Message |
keesp Guest
|
Posted: Thu Jul 07, 2005 8:24 am Post subject: Making rows selectable depending on column position |
|
|
Hi,
Is there a way to make the selection of rows dependable on the columns on which is clicked?
Currently one of my columns are filled with edit boxes, and this introduces dual behaviour when clicking the mouse on these boxes. Editing ON the box will allow editing (as expected), but clicking on the EDGES of the boxes will result in an AllowSelectionChange, which I would (in this case) prefer to ignore.
If possible, I would like to prevent having to calculate mouse / column positions, so a 'SelectedColumn' property would have made may life a lot easier, but I haven't found this....
Thanks,
Kees |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Jul 07, 2005 10:01 am Post subject: |
|
|
Not directly. You could however achieve this fairly easily by creating your own CellWidget class and handling the click event yourself (see code in "Link label or button column" thread).
The default logic is shown below:
Code: |
public override void OnMouseDown(MouseEventArgs e)
{
RowWidget.OnMouseDown(e);
if (Editable && e.Button == MouseButtons.Left)
{
if (!Tree.SelectBeforeEdit || Row.Selected)
{
Tree.EditWidget = this;
}
}
}
|
If you simply omit the RowWidget.OnMouseDown line then clicking on the cell widget will no longer select the row. _________________ Infralution Support |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|