Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1775
XamGrid - multiple column selection through column header
posted

Hi,

When user clicks on column header and drags mouse over other column headers,multiple columns should get selected. I am able to achieve column selection on click of column header by Preview mouse down event of header cell control but multiple column selection through click and drag on column headers, I am not able to achieve. Style used for selection of column on column header is:

<Style TargetType="{x:Type igPrim:HeaderCellControl}"     BasedOn="{StaticResource HeaderCellControlStyle}">          

      <EventSetter Event="PreviewMouseDown" Handler="HeaderControl_PreviewMouseDown" />  

</Style>

Please provide a solution to achive column selection through click and drag of column header. Thanks in advance.

Regards,

Sasikumar

  • 138253
    Offline posted

    Hello Sasikumar,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Offline posted

    Hello Sasikumar,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I handled the HeaderCellControl’s PreviewMouseDown and PreviewMouseMove events in order to make the selection of the Columns. Also I added a check if the Control key is pressed in order to keep the built in functionality for selection using Control. You can add a similar check for the Shift key if you want. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    XamGridColumnSelectionByDraging.zip