Telerik Forums
UI for WPF Forum
1 answer
501 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
133 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
198 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
248 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
146 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
139 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
149 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
2 answers
276 views
Hi All,
    I have an issue where I am binding my ViewModel to the TreeView and using a hierarchical data template to allow a self referencing list of items.

I have got this all working fine - however, when I add a new item to the source list, it causes the itemssource on the treeview to be re-evaluated. This in turn calls the converter (which is using a linq query to find the top level of the tree and children).

I think that by calling this converter, the TreeView is losing track of which items were expanded because when the control refreshes, the TreeView is collapsed

This is my converter code (pretty simple):
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
       {
           var item = value as Structure;
           var items = value as SturctureCollection;
 
           if (items != null)
           {
               return items.Where(i => i.ParentID == 0);
           }
           else if (item != null)
           {
               var parent = (item.Parent as StructureCollection);
 
               return parent.Where(i => i.ParentID == item.ID);
           }
 
           return null;
       }

Any idea if this is easily recitified with an option on the control? If not I assume I will need to track which items are expanded (I was thinking about just putting the IDs in a list and iterating), if so which event is best to use when the underlying itemssource is re-evaluated?

Thanks,
Charles
Petar Mladenov
Telerik team
 answered on 03 Aug 2012
1 answer
108 views
We have started using the Telerik RadControls in our latest WPF application, but our test team are having a few issues when using QTP 11.0 to create automated UI tests for some of the controls.

Specifically, when a RadComboBox is made editable, they can't get QTP to enter text with the 'type' command (which works with a regular WPF ComboBox) as it complains it can't focus on the control. Also with the RadGridView control it doesn't seem to pick the grid up at all, just individual cells.

Has anyone else had any luck using QTP with the WPF RadControls? Any tips or QTP plugins that anyone is aware of?

Thanks for any help,

John
Ivan Ivanov
Telerik team
 answered on 03 Aug 2012
1 answer
88 views
I want to add user control in grid view header template. please guid
Shradha
Top achievements
Rank 1
 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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?