Telerik Forums
UI for WPF Forum
1 answer
85 views

I want show something like the Telerik ExplorerControl in folder-browser mode.  But in my control, I need certain folders are shown with a custom icon /view that will reflect the contents of the folder.   I love all the tree-view functionality of the control and do not want to re-invent all of that.  but I need the main pane to show my view, not Telerik's

Basically when ever a folder contains a file named "scan.yaml" and "image01.png", I want my UI to show the contents of "image01.png" as the folder instead of the regular folder icon.  (My code actually does some background processing to overlay other information on that image sometimes but that's not important for now)

Is this possible or would I need to use my own Tree View?

I thought of a few approaches.  Can you tell me which, if any of these are feasible and which would work best?

1.  Use a ControlTemplate that totally replaces the contents of`PART_MainPane` which is currently this

<historyNavigationPane:FileBrowserTabControl x:Name="PART_MainPane"
        Grid.Column="2"
        SelectedIndex="{Binding ElementName=PART_LayoutConfigurator, Path=SelectedIndex}"
        ItemsSource="{Binding Layouts}"
        ContentTemplateSelector="{StaticResource MainPaneTabControlTemplateSelector}">

 Is it feasible to use a style for ExplorerControl with a ControlTemplate  that completely tears that out and replaces that `FileBrowserTabControl` it with my own control? 

2. Use a ControlTemplate that does not show the MainPane at all and just puts my custom control next to the existing tree view.  My control could then key off its sibling's `CurrentDirectory` property

3. Try to find some way to customize how FileBrowserTabControl shows the folder contents as I described

Would any of these work.

I've attached an image of part of what my control looks like in large-icon mode.  It shows two regular folders and two of the "special" folders that I mentioned

(Also I looked for a question tag for ExplorerControl but could not find one so I tagged "General Discussion")


Dilyan Traykov
Telerik team
 answered on 26 Oct 2022
1 answer
150 views

I have TreeLinesVisibility="Visible" on my TreeListView, as in the XAML snippet below.

<telerik:RadTreeListView x:Name="NEWCollectionControl" Grid.Row="1" EnableLostFocusSelectedState="False" ShowColumnHeaders="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadOutlookBar}}, Path=DataContext.Controller.ShowTreeHeader, Mode=TwoWay}" GridLinesVisibility="None" RowIndicatorVisibility="Collapsed" SelectionUnit="FullRow" ColumnWidth="*" TreeLinesVisibility="Visible" AutoExpandItems="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadOutlookBar}}, Path=DataContext.Controller.TreeViewAutoExpand, Mode=TwoWay}" AutoGenerateColumns="False" ItemsSource="{Binding Items}" IsExpandedBinding="{Binding IsExpanded, Mode=TwoWay}" SelectedCellsChanging="NEWCollectionControl_SelectedCellsChanging" DataLoaded="NEWCollectionControl_DataLoaded" Initialized="NEWCollectionControl_Initialized" SelectionChanged="NEWCollectionControl_SelectionChanged">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:RadTreeListView.Columns>
        <telerik:GridViewImageColumn IsVisible="{Binding Controller.UseTreeViewIcons}" DataMemberBinding="{Binding Image}" TextAlignment="Left" ImageHeight="12" ImageWidth="{Binding ImageWidth}" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Translation.CurrentTranslation}" MinWidth="200" Header="{Binding Controller.PSRDictionary.Collection.CurrentTranslation}" />
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>

However, the GridViewImageColumn, which was added later in order to allow for some icons to the side of the TreeListView, is causing elements of the 3rd hierarchy level onwards to not have those lines. The behaviour can be seen in the image below, and it will happen regardless if the column is visible or not. 

I have tried to mess with many of the properties on these elements but to no success.

 

 

Stenly
Telerik team
 answered on 25 Oct 2022
1 answer
82 views

Hello,

I'm generating columns dynamically, I have a RadGridView with LeftFrozenColumnCount = 1.
It is possible that my grid becomes not visible (for exemple, when switching tab in a TabControl).

But the columns my grid is bound to can still be re-generated.
It seems that way, the grid doesn't update the IsFrozen property of the columns.

I assume this is because the CoerceValueCallback for this propery checks for null on each column.DataControl and if so, returns the base value for the property, which in my case is always equal to false, because I've just generated the columns and they didn't get to the view yet.

I rely on this IsFrozen property to do some custom filtering logic, and it doesn't execute properly because the IsFrozen property isn't updated reliably.

I don't have any issue when coming back to the grid, because the IsFrozen property is then updated correctly: the real problem is in that this property isn't updated properly if the grid is not visible and we change the columns it's bound to.

What can I do to work around this?

Thanks! :)

Petar Mladenov
Telerik team
 answered on 24 Oct 2022
1 answer
127 views
I have a Telerik RadSplitButton defined as follows:
<telerik:RadSplitButton Style="{StaticResource MySplitButtonStyle}" Content="Some Text" DropDownHeight="150">
  <telerik:RadSplitButton.DropDownContent>
    <ListBox>
      <ListBoxItem Content="Item 1" />
      <ListBoxItem Content="Item 2" />
      <ListBoxItem Content="Item 3" />
      <ListBoxItem Content="Item 4" />
      <ListBoxItem Content="Item 5" />
    </ListBox>
  </telerik:RadSplitButton.DropDownContent>
</telerik:RadSplitButton>
I am using the NoXaml version of the assemblies and so I have styled the split button based on a style that I got from a Telerik theme (Telerik.Windows.Controls.xaml file).  The style contains the following:
<Style x:Key="MySplitButtonStyle" TargetType="telerik:RadSplitButton">
  ...
  <Setter Property="ButtonPartStyle" Value="{StaticResource MyButtonStyle}"/>
  <Setter Property="IsToggle" Value="False"/>
  <Setter Property="IsTabStop" Value="True" />
  <Setter Property="IsOpen" Value="False" />
  <Setter Property="CloseOnPopupMouseLeftButtonUp" Value="True" />
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="telerik:RadSplitButton">
        ...
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

When I use the Tab-Navigation to cycle through the controls on the page (because I have no mouse for example), this RadSplitButton gets the focus as expected.  So far so good.  However, when I then try to interact with this RadSplitButton using the keyboard (because I have no mouse) I can't seem to get the main button to activate and I cannot change the selected item in the drop-down.

When the RadSplitButton has focus:

- When I press the Spacebar or the Enter key, the drop-down opens but no events fires.  I would expect the button to get clicked or the Activate event to get fired.

- When I press the down-arrow key the drop-down opens and shows me the list box but the list box does not get keyboard focus and so I cannot navigate (using keys).  I cannot select an item from the drop-down as I can with a normal list box.

Can you suggest some changes that might help me to fix this?  Ideally, I would like to do this from the style and not have to add event handlers to every SplitButton.

Thanks
Vladimir Stoyanov
Telerik team
 answered on 24 Oct 2022
0 answers
116 views
i want to add a cubic bezier curve to a canvas with a start point and an end point, i cant do it in the xaml it has to be in the c# because the points are constantly changing
Conrad
Top achievements
Rank 1
 asked on 22 Oct 2022
4 answers
243 views
Hi, is there a way to change the data type returrned by the NumericUpDown's value? I need it to be int, not double, because it's mapped to a database field which has an int type, and I'm getting a conversion error. Thanks.
alex
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 22 Oct 2022
0 answers
189 views
I have a RadGridview where I select 3 cells and I paste 5 cells copied from excel,notepad,etc., now i have 2 new rows added(empty rows acting as new row). I tried setting insertnewrows=false and also allselectedcells but no use. help would be appreciated.  
Shivam
Top achievements
Rank 1
Iron
 asked on 21 Oct 2022
1 answer
151 views

I want to drag and drop files from a RadGridView to Outlook. Each line in my grid represents an Invoice including PDF file.
My users want to drag items into an Outlook message in order to send the PDF as attachment. (one or more)

I've been trying to search for a way to do it, but I can only find examples to drag-and-drop within the same application.

Martin Ivanov
Telerik team
 answered on 21 Oct 2022
1 answer
106 views

Is there a way to have a custom event on a GridViewHyperlinkColumn and disable the primary default behavior?

Currently I can add a handler to the Hyperlink.Click event, but the control seems to always have the default click event enabled.

For example, if my custom event opens a link, then the above behavior ends up opening duplicate links.

 

Thanks,

Nelson

Stenly
Telerik team
 answered on 19 Oct 2022
1 answer
186 views

Hi,    

I'm trying to create a custom component that inherits from RadGanttView, but I'm not sure what the intended workflow is intended to be. Namely to set my columns, rows, taskssource,... up. Here are the steps that I took:  

1- Create a "CustomGantt.cs" class that inherits from RadGanttView   

2- Create a Generic.xaml file. Within that file, create a style that targets CustomGantt and is based on the default RadGanttViewStyle   

3- Add said Generic.xaml file to my App.Resources   

Now I can add my CustomGantt control to any of my views, and it does display a Gantt as intended, however, this, is not enough as I've yet to define my columns, rows, source,.... But I'm unsure of what the best way to do that is supposed to be. Should I create a ControlTemplate within my Generic.xaml file in which I add a RadGanttView that I can then set up?     

Thanks a lot for your help!

Dilyan Traykov
Telerik team
 answered on 19 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?