Home Forums WPF controls Xceed DataGrid for WPF 2D selection Possible?

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

    Is it possible to select mutliple colums and rows without selecting the entire row? So if I wanted to select two colums in 10 different rows is that possible?

    Thanks

    Robert

    Imported from legacy forums. Posted by Robert (had 465 views)

    Xceed Support
    Member
    Post count: 5658

    Currently, only row selection is available; however, this thread may help you in implementing the feature yourself.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 247 views)

    User (Old forums)
    Member
    Post count: 23064

    We are very excited about your product. The only requirement we have that is not covered by your grid control is the 2d selection. It would be a great help if you had an example of how to implement this.  I have looked at the post above but still can’t seem to get it to work.

    Thanks for your time,

    Robert

    Imported from legacy forums. Posted by Robert (had 327 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Robert,

    You could try something like the following:

             <!– IMultiValueConverter that simply returns:  return ( ( values[ 0 ] == values[ 1 ] ) ); in the Convert method–>
             <local:CurrentToBooleanMultiConverter x:Key=”currentToBooleanConverter” />
             
             <Style TargetType=”{x:Type xcdg:DataCell}”>
                <Style.Triggers>
                   <DataTrigger Value=”True”>
                      <DataTrigger.Binding>
                         <MultiBinding Converter=”{StaticResource currentToBooleanConverter}”>
                            <Binding RelativeSource=”{RelativeSource Self}”
                                     Path=”ParentColumn” />
                            <Binding RelativeSource=”{RelativeSource Self}”
                                     Path=”(xcdg:DataGridControl.DataGridContext).CurrentColumn”/>
                         </MultiBinding>
                      </DataTrigger.Binding>

                      <Setter Property=”Background”
                              Value=”Pink” />
                   </DataTrigger>
                </Style.Triggers>

             </Style>

    Now this style does not manage the multiple selection of columns but it will allow you to select the current column and rows at the same time.

    Hope this helps [:)]

    Imported from legacy forums. Posted by Jenny [Xceed] (had 1212 views)

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