Is it possible to change the orientation of TaskBoard columns (make them rows)?

Views for WPF Forum

Posted 3 years ago by JP Garza
Version: 19.1.0685
Avatar

I want to use the drag-drop functionality on my ListView items. It seems like the only way to do that is to replace my ListView with a TaskBoard.

1. Is it possible to change the orientation of the TaskBoard columns?

2. Is it possible to use card dragging without the TaskBoard?

3. Is it possible to drag-drop cards between different columns in different TaskBoards?

I currently have 2 TaskBoards with 1 Column each and multiple Cards each. I want to be able to move Cards from one TaskBoard Column to another.

Thanks.

[Modified 3 years ago]

Comments (4)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

You can't change the orientation of the TaskBoard columns, use cards without a TaskBoard, or drag/drop between TaskBoards.

Are you just trying to have two vertical "list-looking" controls?  If so, can't you make a single TaskBoard with two columns and drag cards between those columns.  Or are the "lists" in different locations in your app window and not next to each toher?

On a side note you can always retemplate the TaskBoard control so that it just has an ItemsPresenter in it.  Then add a single column to the TaskBoard and retemplate TaskColumn to also mainly be something like a Border with an ItemsPresenter.  If you do those things, it should render more like a plain list.


Actipro Software Support

Posted 2 years ago by JP Garza
Avatar

Hello, 

Thanks for the reply.

I am trying to create a Dashboard feature where:

Dashboard
    has > Rows (are draggable)
          have > Columns (not draggable)
                have > Widgets (draggable between columns) 

I used Gong-DragDrop-WPF to implement it at first which worked great, but I was not happy with the animation and I was hoping I didn't have to write the animation code myself. Therefore, I looked into Actipro TaskBoard. The TaskBoard worked great for my Rows since they are all in one list, but does not work with my Widgets which can leave in any Column list.

Take a look here: https://drive.google.com/file/d/1BDSYyKS_rWguEbwCK2ZEJMm5u0624-GV/view?usp=sharing

As you can see from the GIF, the Rows use TaskBoard and looks awesome! But, the Widget dragging still uses Gong-DragDrop-WPF library to move between different lists. The way it works is that it allows objects of the same type/interface to be around lists with those same types/interfaces.

So, is there any trick/re-template I could do so that I can move widgets/objects across different lists?

Thanks!

[Modified 2 years ago]

Posted 2 years ago by JP Garza
Avatar

By the way, I did this:

On a side note you can always retemplate the TaskBoard control so that it just has an ItemsPresenter in it.  Then add a single column to the TaskBoard and retemplate TaskColumn to also mainly be something like a Border with an ItemsPresenter.  If you do those things, it should render more like a plain list.

But when I do that I can no longer drag TaskCards.

I get this error:

File: ActiproSoftware.Windows.Controls.Views.TaskBoard+TaskCardDragProcessor
Line #: 0
Method: Void CreateDragAdornment(System.Windows.Point)
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.

My code:

 <views:TaskBoard
                CanCardsDrag="True"
                CanColumnsDrag="False"
                CardDragRotationAngle="0">
                <views:TaskBoard.Template>
                    <ControlTemplate TargetType="views:TaskBoard">
                        <ItemsPresenter />
                    </ControlTemplate>
                </views:TaskBoard.Template>
                <views:TaskBoard.Items>
                    <!--  AKA: 1 item only (The Dasboard)  -->
                    <views:TaskColumn
                        Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=views:TaskBoard}}"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Top"
                        HorizontalContentAlignment="Stretch"
                        ItemsSource="{Binding DashBoard.DashboardRows, RelativeSource={RelativeSource AncestorType=local:DashBoardUserControl}}">
                        <views:TaskColumn.Template>
                            <ControlTemplate>
                                <Grid VerticalAlignment="Top">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="auto" />
                                    </Grid.RowDefinitions>

                                    <!--  ROWS  -->
                                    <ScrollViewer Margin="0,1,0,0" VerticalScrollBarVisibility="Auto">
                                        <ItemsPresenter Margin="5,5,5,0" />
                                    </ScrollViewer>

                                    <!--  ADD ROW BUTTON  -->
                                    <StackPanel
                                        Grid.Row="1"
                                        HorizontalAlignment="Center"
                                        Orientation="Horizontal"
                                        Visibility="{Binding IsEditting, Converter={StaticResource bool2vis}, RelativeSource={RelativeSource AncestorType=local:DashBoardUserControl}}">
                                        <ContentControl Template="{Binding AddRowSectionTemplate, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DashBoardUserControl}}" />
                                    </StackPanel>
                                </Grid>
                            </ControlTemplate>
                        </views:TaskColumn.Template>
                    </views:TaskColumn>
                </views:TaskBoard.Items>
            </views:TaskBoard>

[Modified 2 years ago]

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

TaskBoard is only designed to be two layers (columns / cards) whereas it sounds like you have three layers (rows, columns, widgets) here.  So unfortunately you would have to use some other way (like that library you mentioned) to support moving widgets around.

For the exception, I believe you are missing the required adornment canvas part that is in our default TaskBoard Template:

<ControlTemplate TargetType="views:TaskBoard">
	<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" 
			Background="{TemplateBinding Background}">
		<Grid>
			<views:InertiaScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
				<StackPanel Margin="{TemplateBinding Padding}" Orientation="Horizontal">
					<ItemsPresenter />
									
					<ContentPresenter Content="{Binding}" ContentTemplate="{TemplateBinding FooterTemplate}"
										Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HasFooter, Converter={StaticResource BooleanToVisibilityConverter}}" />
				</StackPanel>
			</views:InertiaScrollViewer>

			<Canvas x:Name="PART_AdornmentCanvas" IsHitTestVisible="False" />
		</Grid>
	</Border>
</ControlTemplate>

Add that Canvas back in and the exception should be fixed.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.