Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Making rows selectable depending on column position

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
keesp
Guest





PostPosted: Thu Jul 07, 2005 8:24 am    Post subject: Making rows selectable depending on column position Reply with quote

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

PostPosted: Thu Jul 07, 2005 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
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