Telerik Forums
UI for WPF Forum
2 answers
151 views
Hi,

This is likely an uncommon question, but is it possible to set the column that the user clicks on to expand the tree and the same one that is indented, to be the second column (or any other column but the first one)?

Thanks
Peter
Top achievements
Rank 1
 answered on 05 Aug 2012
2 answers
298 views
Hi,

I'm trying to get Key Tips working for the buttons in my RadRibbonView. It's based on your mvvm example. I have managed to bind AccessText to the buttons with ease and to the RadRibbonGroup through a setter in ItemContainerStyle of the HierarchicalDataTemplate.

But none of these KeyTips will show unless the parent RadRibbonTab has AccessText set. But setting this property seems like a tough challenge.

<HierarchicalDataTemplate x:Key="GroupHeaderTemplate" ItemsSource="{Binding Buttons}"  DataType="{x:Type Menu:GroupViewModel}"
                   ItemTemplateSelector="{StaticResource groupsSelector}">
           <TextBlock Text="{Binding Text}" />
       </HierarchicalDataTemplate>
 
       <HierarchicalDataTemplate x:Key="TabTemplate" DataType="{x:Type Menu:TabViewModel}" ItemsSource="{Binding Groups}"                                             
                   ItemTemplate="{StaticResource GroupHeaderTemplate}">
           <HierarchicalDataTemplate.ItemContainerStyle>
               <!-- This works and AccessText binds to GroupViewModel.AccessText -->
               <Style TargetType="{x:Type telerik:RadRibbonGroup}">
                   <Setter Property="telerik:KeyTipService.AccessText" Value="{Binding AccessText}" />
               </Style>
           </HierarchicalDataTemplate.ItemContainerStyle>
           <TextBlock Text="{Binding Text}" />
       </HierarchicalDataTemplate>

Update:
I tried setting ItemContainerStyle directly on RibbonView, now KeyTips show for the Tabs, but not for Groups or Buttons (even though the AccessText property is invoked on each viewmodel)
<telerik:RadRibbonView  x:Name="ribbonView" ApplicationButtonVisibility="Collapsed"
                      VerticalAlignment="Top" ItemTemplate="{StaticResource TabTemplate}" ItemsSource="{Binding Tabs}"
                       Title="{Binding Title}" SelectedItem="{Binding SelectedTab, Mode=TwoWay}"                       
                      telerik:KeyTipService.IsKeyTipsEnabled="true"                       
                      telerik:KeyTipService.AccessKey="ALT">
          <telerik:RadRibbonView.QuickAccessToolBar>
              <telerik:QuickAccessToolBar ItemsSource="{Binding QuickAccessItems}"
                      ItemTemplate="{StaticResource ButtonTemplate}" />
          </telerik:RadRibbonView.QuickAccessToolBar>
  <telerik:RadRibbonView.ItemContainerStyle>
      <!-- This style seems to affect all containers, tabs, groups and buttons -->
          <Style>                   
              <Setter Property="telerik:KeyTipService.AccessText" Value="{Binding AccessText}" />
          </Style>
  </telerik:RadRibbonView.ItemContainerStyle>
  </telerik:RadRibbonView>

I am trying to implement a very standard feature...
 Please help me,
Thanks
Oscar Ågren
Top achievements
Rank 1
 answered on 04 Aug 2012
0 answers
97 views
I have hierarchy level RadGridView in wpf application. I want to export all level data in excel format. But it exports only first level data into excel.

waiting for your reply
thank you. 
Nikita
Top achievements
Rank 1
 asked on 04 Aug 2012
1 answer
488 views
Hi all,

Is there a way to increase or decrease the spacing between letters in a word (code behind)?

thanks
Iva Toteva
Telerik team
 answered on 03 Aug 2012
1 answer
131 views
Sir,

I have a situation where i want to handle Handling One to Many relation in Mail Merge of radrichtextbox.

e.g

 

 

public class Employee

 { 

public string FirstName { get; set; }  

public string LastName { get; set; }  

public string JobTitle { get; set; }  

public List<Address> EmpAddress { get; set; }  

}

 

public class Address  

public string Addresses { get; set; }  

}

How i will handle this situation in the case of Mail Merge. Where i want to show one employee with its multiple addresses in the table in the mail merge.

Thanks
Rizwan

Iva Toteva
Telerik team
 answered on 03 Aug 2012
0 answers
193 views
Hello


There is a demo application to test some components of telerik. No complex code, only "play" with some properties.

From visual studio works great, including the publication did not present any problems, no warning, no errors.

So far so good ...

However, when you want to run the published application from the IE browser, it displays an error window abruptly.

Running the application from within visual studio shows aparentmente an initialization error telerik controls, something like:

System.TypeInitializationException was unhandled<br>Message: Se produjo una excepción en el inicializador de tipo de 'Telerik.Windows.Documents.UI.Extensibility.RadCompositionInitializer'.


This application in the event Page_Loaded performs an initial load of data in a RadGridView against sqlserver is performed without any problems, showing the data and then to the second application is aborted with the error described above.

How I can solve this?


In advance thank you all ....
Romell
Top achievements
Rank 1
 asked on 03 Aug 2012
5 answers
241 views
Am I aiming for the wrong thing to think I can use the RadTimePicker to select a Timepsan?

I need get rid of the AM PM and also stop it from thinking/displaying 00:00:00 as 12:00PM?

ohhh and what exactly am i binding to? SelectedTime={binding TimeSpan}?

thanks in advance

Michael
Michael
Top achievements
Rank 1
 answered on 03 Aug 2012
3 answers
145 views
Hi,

I have created new GridViewDateTimeColumn that will handle DateTime properties. In this column I have added one dependency property that will define StringFormat for DateTime values.

// Dependency Property
public static readonly DependencyProperty StringFormatProperty =
             DependencyProperty.Register("StringFormat", typeof(string),
             typeof(GridViewDateTimeColumn), new FrameworkPropertyMetadata(string.Empty, StringFormatChanged));
 
public string StringFormat
{
    get { return (string)GetValue(StringFormatProperty); }
    set { SetValue(StringFormatProperty, value); }
}
 
private static void StringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var column = (GridViewDateTimeColumn)d;
    column.DataMemberBinding.StringFormat = e.NewValue.ToString();
    column.Refresh();
}

xaml

<my_controls:GridViewDateTimeColumn DataMemberBinding="{Binding SomeDateTimeProperty, Mode=TwoWay}"
                 StringFormat="{Binding DataContext.StringFormat, RelativeSource={RelativeSource AncestorType=UserControl}}"
                                                        >

However, since the cell/column layout is created only once, I am unable to force the Column to rebind its values. StringFormatChanged is executed, and StringFormat property for column DataMemberBinding is set correctly, but original StringFormat is still active.

How can I make this work?

Regards,
Goran
Goran
Top achievements
Rank 1
 answered on 03 Aug 2012
3 answers
135 views
Hello,

I have a TreeListView which is supposed to show a collection with different filters applied in two view states, the states are maintained by one bool property in the view model.

The value converter works correctly in that I can see the values being passed and returned, and in one of the states all items in the collection are shown correctly in the view. When switching back to the previous state, and the second collection view is bound, only a few of the rows are shown, even though this second collection contains the required number rows.

<telerik:RadTreeListView.ItemsSource><br>               
<
MultiBinding Converter="{StaticResource IsExpandedToCollectionViewConverter}">
                    <Binding Path="IsExpanded"/>
                    <Binding Path="DataContext" RelativeSource="{RelativeSource AncestorType=Grid}"/>
        </MultiBinding>
</telerik:RadTreeListView.ItemsSource>


The above code shows how the ItemsSource is bound, the IsExpanded property maintains the state is a boolean, and DataContext is the viewModel with the two collection view properties.

The two collectionview sources are SummaryView and SortedView. When the control is first loaded, the summary view is shown, when expanded the SortedView is shown. 

Additionally, if the SummaryView is empty, then the Visibility of the treelistview is set to collapsed. In the expanded view the treelistview, the visibility however works fine.

Thank You

Hasanain



Vera
Telerik team
 answered on 03 Aug 2012
1 answer
148 views
Hello,

In the scenario that we have, we need to drag items from a TreeView onto an image.  The image is a map and has a couple of collections items added to display on top of the map.  I am using the RadDragAndDropManager to drop items onto the map.

Here is the XAML for defining the target:

....
<Grid x:Name="mapGrid"
                  Visibility="{Binding Text, ElementName=mapFilenameTextBox, Converter={StaticResource StringEmptyToVisibilityConverter}}"
                  HorizontalAlignment="Center" VerticalAlignment="Center"
                  Margin="2">
                <Image x:Name="mapImage"
                       Source="{Binding MapFilename, Mode=OneWay}"
                       Stretch="Uniform" StretchDirection="Both" SizeChanged="mapImage_SizeChanged" Loaded="mapImage_Loaded"/>


                <ItemsControl x:Name="mapSymbolLabelsItemsControl"
                              ItemsSource="{Binding MapSymbolLabels}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <Canvas>
                                <Canvas.Background>
                                    <SolidColorBrush Opacity="0"/>
                                </Canvas.Background>
                            </Canvas>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemContainerStyle>
                        <Style>
                            <Setter Property="Canvas.Top" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Top}" />
                            <Setter Property="Canvas.Left" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Left}" />
                            <Setter Property="Label.ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=LabelName}" />
                        </Style>
                    </ItemsControl.ItemContainerStyle>
                </ItemsControl>


                <ItemsControl x:Name="mapAreaItemsControl"
                              AllowDrop="True"
                              Drop="mapAreaItemsControl_Drop"
                              MouseLeftButtonDown="mapAreaItemsControl_MouseButtonDown"
                              MouseRightButtonDown="mapAreaItemsControl_MouseButtonDown"
                              MouseMove="mapAreaItemsControl_MouseMove"
                              GiveFeedback="mapAreaItemsControl_GiveFeedback"
                              ItemsSource="{Binding MapSymbols}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <Canvas x:Name="mapCanvas">
                                <Canvas.Background>
                                    <SolidColorBrush Opacity="0"/>
                                </Canvas.Background>
                            </Canvas>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemContainerStyle>
                        <Style>
                            <Setter Property="Canvas.Top" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Top}" />
                            <Setter Property="Canvas.Left" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Left}" />
                            <Setter Property="Image.ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=SymbolName}" />
                        </Style>
                    </ItemsControl.ItemContainerStyle>
                    <ItemsControl.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="{l:Translate DeleteContextMenuItem}" Command="{Binding DeleteSelectedMapSymbolsCommand}"/>
                        </ContextMenu>
                    </ItemsControl.ContextMenu>
                </ItemsControl>
            </Grid>
...

In the Constructor of the view, I set up the DragAndDropEvents:
RadDragAndDropManager.SetAllowDrop(mapAreaItemsControl , true);
RadDragAndDropManager.AddDropQueryHandler(mapAreaItemsControl, new EventHandler<DragDropQueryEventArgs>( OnDropQuery ) );
RadDragAndDropManager.AddDropInfoHandler(mapAreaItemsControl, new EventHandler<DragDropEventArgs>( OnDropInfo ) );

What I am seeing with this is that OnDropQuery fires once and I set the query result to true to enable the drop.
private void OnDropQuery( object sender, DragDropQueryEventArgs e )
{    
    e.QueryResult = true;
    e.Handled = true;
}

I expect that the drag status should be allowed at this point, but its being set to DropImpossible.

I did notice that the OnDropInfo event is being fired twice - the first time, the drag status is DropPossible, but the second time, the drag status is DropImpossible.  The sender both times is the items control and this happens weather the items control is empty or not.  I have tried several combinations of allowing drop to the containing grid, the image, the item control and all of them, but the result is the same.  

Here is the call stack when drop status is DropPossible:
> XXXXXXXXX.OnDropInfo(object sender, Telerik.Windows.Controls.DragDrop.DragDropEventArgs e) Line 57 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Line 46 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.DragDropProvider_DropInfo(object sender, Telerik.Windows.Controls.DragDrop.DragDropEventArgs e) Line 311 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropProviderBase.RaiseDropInfo() Line 215 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropProvider.OnElementDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e) Line 247 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Line 182 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.IInputElementExtensions.RaiseEvent(System.Windows.DependencyObject d, System.Windows.RoutedEventArgs routedEventArgs) Line 83 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnDragEventHandler(object sender, System.Windows.DragEventArgs e) Line 1731 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnOver(object sender, System.Windows.DragEventArgs e) Line 1807 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(System.Windows.DependencyObject dragSource, object data, System.Windows.DragDropEffects allowedEffects, System.Windows.DragDropKeyStates initialKeyState, object dragVisual, System.Windows.Point relativeStartPoint, System.Windows.Point dragVisualOffset) Line 1018 + 0xe bytes C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDrag() Line 238 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(System.Windows.UIElement sender) Line 191 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(object sender, System.Windows.Input.MouseEventArgs e) Line 163 + 0x1e bytes C#
  [External Code]



Here is the call stack when drop status is DropImpossible:
> XXXXXXX.OnDropInfo(object sender, Telerik.Windows.Controls.DragDrop.DragDropEventArgs e) Line 56 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Line 46 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.DragDropProvider_DropInfo(object sender, Telerik.Windows.Controls.DragDrop.DragDropEventArgs e) Line 311 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropProviderBase.RaiseDropInfo() Line 215 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropProviderBase.NotifyPreviousApprovedDestination() Line 372 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropProviderBase.OnDropImpossible() Line 403 + 0xb bytes C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.DragDrop.DragDropProvider.OnElementDragLeave(object sender, Telerik.Windows.DragDrop.DragEventArgs args) Line 295 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Line 182 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.IInputElementExtensions.RaiseEvent(System.Windows.DependencyObject d, System.Windows.RoutedEventArgs routedEventArgs) Line 83 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnDragEventHandler(object sender, System.Windows.DragEventArgs e) Line 1731 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DelegateHelper.OnLeave(object sender, System.Windows.DragEventArgs e) Line 1797 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(System.Windows.DependencyObject dragSource, object data, System.Windows.DragDropEffects allowedEffects, System.Windows.DragDropKeyStates initialKeyState, object dragVisual, System.Windows.Point relativeStartPoint, System.Windows.Point dragVisualOffset) Line 1018 + 0xe bytes C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDrag() Line 238 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(System.Windows.UIElement sender) Line 191 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(object sender, System.Windows.Input.MouseEventArgs e) Line 163 + 0x1e bytes C#
  [External Code]


As noted, Ive tried several combinations of allowing and handling the drag drop events for all of the elements in the view, I cannot get the result to remain DragPossible so that I can actually perform the drop.


Petar Mladenov
Telerik team
 answered on 03 Aug 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?