Telerik Forums
UI for WPF Forum
3 answers
143 views
Hello,

I am using the Richtextbox to create a text that the user can then copy to outlook or word. In this text I also have a table. But when it is coppied every cell starts on a new line. Do I need to set something so the table is Copied as a real table?

I used to use the windows Richtextbox with FlowDocument and there this worked only line ends were skipped.
Martin Ivanov
Telerik team
 answered on 17 Apr 2012
2 answers
221 views

I'm experiencing a strange behavior: The RadBusyIndicators's content (the yellow circle and the text "Loading...") appears far too late, but the BusyIndicator becomes grey at the right moment. The content (progress bar) appears not until the time-consuming action is over.

Here is what I'm doing in Pseudocode:

MyDialog dialog = new Dialog();             // A Window that contains the BusyIndicator
dialog.myRadBusyIndicator.IsBusy = true;    // Startup with the BusyIndicator activated
dialog.Dispatcher.BeginInvoke(new System.Action(MyLoginAction));   // Start some time-consuming action in the Background
dialog.ShowDialog();                        // Show the user a Dialog with busy information

Problem: The yellow circle in the BusyIndicator shows up AFTER the time-consuming action is over, but Busy-State (graying) is activated correctly when the Dialog pops up.

Some intricate threading problem?

Peter
Top achievements
Rank 1
 answered on 17 Apr 2012
1 answer
138 views
I have to use the control RadDropDownButton and inside that I have to place a usercontrol

Till here it works fine for me.
But I need to resize the telerik:RadDropDownButton.DropDownContent. I need a splitther or a resizer at the bottom of the DropDownContent to resize the content area where I have placed my control. pls tell how to achieve that thing.
Tina Stancheva
Telerik team
 answered on 17 Apr 2012
3 answers
302 views
Hi,

I'm looking for a way to call the save command from code behind. I tried different kinds of maner but with no success.

Thanks
Vasil
Telerik team
 answered on 17 Apr 2012
2 answers
168 views
I have a RadComboBox on a form in my WPF application:

<telerik:RadComboBox BorderBrush="{DynamicResource ControlBorder}"
                     CanAutocompleteSelectItems="True"
                     Focusable="True"
                     FontSize="18"
                     FontWeight="Bold"
                     Foreground="{DynamicResource TextForeground}"
                     Height="32"
                     HorizontalAlignment="Left"
                     IsEditable="True"
                     IsFilteringEnabled="True"
                     IsTextSearchCaseSensitive="False"
                     IsTextSearchEnabled="True"
                     ItemsSource="{Binding Path=RecentUsers, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type c:LoginForm}}}"
                     Name="UsersName"
                     TabIndex="1"
                     Width="300" />

In my code-behind, I have declared a DependencyProperty called RecentUsersProperty:

public static readonly DependencyProperty RecentUsersProperty =
    DependencyProperty.Register( "RecentUsers", typeof( string[] ), typeof( LoginForm ), new PropertyMetadata( null ) );
  
public string[] RecentUsers {
    get { return (string[]) GetValue( RecentUsersProperty ); }
    set { SetValue( RecentUsersProperty, value ); }
}

In the Loaded event handler of the window that contains this field, I set the RecentUsers to an array of strings retrieved from the database:

RecentUsers = DataInterface.GetRecentUsers( 90 );

Here's the data that's returned by the call to GetRecentUsers:

"adam.st.onge@eoc4.elsagrd.com"
"chris.theet"
"jklepacz1"
"nwhaley"
"rcass"
"tonyb"
"tony.vitabile"

When the window is displayed and I start typing the name of a user that is in the RecentUsers array, autocomplete does not fill in the rest of the matching name.  If I tab out of the field, though, it selects the first one that matches. 

What am I doing wrong?  I'm using the 2012.1.326.40 version of the Telerik libraries.

Tony
Tony
Top achievements
Rank 1
 answered on 17 Apr 2012
4 answers
222 views
We are currently evaluating RadTreeView and we have an MVVM sorting scenario that is not working correctly.  Note that everything was working fine with another treeview that was just a standard ItemsControl with some multi-selection capabilities added.  

Certain nodes in the tree are sorted by adding SortDescriptions to ListCollectionView and the sorting works fine when items are added or removed.

The problem I'm having is with updating the sort order in reaction to changes made to the backing viewmodel objects.  I am trying to leverage IEditableCollectionView as described here:  http://drwpf.com/blog/category/collections/.

In the code below, treeViewItem is the RadTreeViewItem that is attached to the modified object:

IEditableCollectionView ev = treeViewItem.ParentTreeView.Items;

if (ev != null)
{
    // this forces the parent to re-sort in response to the sort field changing
    ev.EditItem(treeViewItem.DataContext);
    ev.CommitEdit();
}

The code compiles & runs, but the tree is not updated with the new sort order.

If I instead call refresh, the treeview is updated with the correct sort order:

treeViewItem.ParentTreeView.Items.Refresh();

However, the tree can have hundreds of items in it and I really don't want to call Refresh for performance reasons.  

Is there a way to get this scenario working?  This is the one thing preventing us from being able to use RadTreeView instead of the TreeView we were using before.

Tina Stancheva
Telerik team
 answered on 17 Apr 2012
1 answer
142 views

I am using a RadRichTextBox as a Rich Content Viewer. (WPF 40)

What is the correct way to Bind TransitionControl with fadeEffect to a read-only RadRichTextBox (RRTB) control?

There is no user input in this process. (Remote display only)

The RadRichTextBox is loaded from Database with Html from code behind on a seperate thread every 5 seconds.  

Is there an example of binding RRTB Data Context to transition, or an example of binding a RRTB Data Template to transition?

Because it’s Read-only, How do I bind the changing Data (with HtmlFormatProvider or RRTB directly)

 Or is there a strictly XAML way to bind with declaratives?

I am trying to keep this as simple as possible.

What do I have to do to the following code to add Fade Transition to RadRichTextBox1?

 

The XAML:

<telerik:RadRichTextBox  x:Name="RadRichTextBox1"

    IsReadOnly="True"

    IsEnabled="True"

    IsSelectionEnabled="False"

    IsFocusable="False"

    HorizontalAlignment="Left"

    VerticalAlignment="Top"

    Height="595"

    Width="1050"

    Margin="20,122,0,0">

</telerik:RadRichTextBox>

 

VB - Code Behind Snippet:

            Dim HtmlMsg as String= MSG_TXT.ToString                             ‘  load  HTML from DB

 

             Me.RadRichTextBox1.IsSpellCheckingEnabled = False

             Me.RadRichTextBox1.Document = Me.htmlFormatProvider.Import(HtmlMsg)    

‘

Ivailo Karamanolev
Telerik team
 answered on 17 Apr 2012
1 answer
112 views
Hi,

in the RadControls WPF Demo Q3 2011 SP1, the cursor cycles through all enabled fields on a RadDataForm by
pressing the Tab key. That's the expected behavior, but in Version 2012.1.402.40 the cursor cycles through all
enabled fields and their corresponding labels.

Is this correct and the expected behavior or is it possible to configure the TabStop behavior
for the label property?

I looked around for a solution and found the thread label-customization-in-dataformxfield
which guided me to the property LabelStyle.

I copied the posted code an set the property IsTabStop to false, but the XAML didn't compile because of
'TextBlock' TargetType does not match type of element 'ContentControl'.
I set the TargetType to ContentControl and it works as expected.

<telerik:RadDataForm.LabelStyle>
     <Style TargetType="ContentControl">
         <Setter Property="IsTabStop" Value="False" />
     </Style>
</telerik:RadDataForm.LabelStyle>

kind regards,
Hubert
Dimitrina
Telerik team
 answered on 17 Apr 2012
1 answer
189 views
Hello Telerik,

I am unable to Edit the Template of the RadWindow using Expression Blend. I wanted to style the RadWindow Border to White, Customize the Minimize, Maximize and Close Buttons as well as give Shadow Effect to the Border. Can you please give the RadWindow Style & Template?

Thanks,
Neha
Dani
Telerik team
 answered on 17 Apr 2012
2 answers
659 views
Some weeks ago I implemented a CustomGridViewToggleRowDetailsColumn class.  Basically, my data model has objects called Reads which can have zero or more Alarms associated with them.  I've written code which populates an array in the Read view model object with all of the Alarms that are associated with that particular Read.  The class hides the toggle button for the row details if the item in the row doesn't have any rows in that array.  There's another boolean property on the Read view model object called HasAlarms which is true if the Alarms array isn't empty.

In order to improve performance, I need to rework the data access code so it no longer retrieves all of the Alarms assocated with a Read at the time it retrieves the Reads that match the search criteria.  Instead, I am setting the HasAlarms property to true if there are any Alarms for that Read and leaving the array null. I want the row details toggle button to be hidden if HasAlarms is false (easily done with existing code).  Then, when the user clicks on the toggle button, I want to check to see if the Alarms for that Read were retrieved yet, and if not, go get them.

The problem is that I'm getting an error when the Xaml for the RadGridView is being parsed because it doesn't like something about my code.  The error I'm getting is:

System.Windows.Markup.XamlParseException occurred
  Message='Failed to create a 'Click' from the text 'ExpandAlarms_Click'.' Line number '416' and line position '9'.
  Source=PresentationFramework
  LineNumber=416
  LinePosition=9
  StackTrace:
       at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at CarSystem.CustomControls.Searcher.InitializeComponent() in d:\ElsagTFS\EOC4\Client UI\CustomControls\Searcher.xaml:line 1
       at CarSystem.CustomControls.Searcher..ctor() in D:\ElsagTFS\EOC4\Client UI\CustomControls\Searcher.xaml.cs:line 431
  InnerException: System.ArgumentException
       Message=Error binding to target method.
       Source=mscorlib
       StackTrace:
            at System.Delegate.CreateDelegate(Type type, Object target, String method, Boolean ignoreCase, Boolean throwOnBindFailure)
            at System.Xaml.Schema.SafeReflectionInvoker.CreateDelegate(Type delegateType, Object target, String methodName)
            at System.Xaml.EventConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value)
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
            at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
            at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter`1 typeConverter, Object value, XamlMember property, String targetName, IAddLineInfo lineInfo)
       InnerException:

Here's the code for my class.  Please help me fix this problem.

    class CustomGridViewToggleRowDetailsColumn : GridViewBoundColumnBase {
  
        public static RoutedEvent ClickEvent =
            EventManager.RegisterRoutedEvent( "Click", RoutingStrategy.Bubble, typeof( ToggleRowDetailsColumnRoutedEventHandler ), typeof( CustomGridViewToggleRowDetailsColumn ) );
  
        public GridViewCell Cell { get; set; }
  
        public event RoutedEventHandler Click {
            add { AddHandler( ClickEvent, value ); }
            remove { RemoveHandler( ClickEvent, value ); }
        }
  
        public override object Header {
            get { return null; }
            set { base.Header = value; }
        }
        public GridViewToggleButton ToggleButton { get; set; }
  
        private Binding toggleButtonVisibility;
        public Binding ToggleButtonVisibility {
            get { return toggleButtonVisibility; }
            set { toggleButtonVisibility = value; }
        }
  
        public CustomGridViewToggleRowDetailsColumn() {
            // Set the EditTriggers property to None
            this.EditTriggers = GridViewEditTriggers.None;
        }
  
        public override bool CanFilter() {
            return false;
        }
  
        public override bool CanGroup() {
            return false;
        }
  
        public override bool CanSort() {
            return false;
        }
  
        public override FrameworkElement CreateCellElement( GridViewCell cell, object dataItem ) {
            Cell = cell;
  
            ToggleButton = new GridViewToggleButton { 
                Margin = new System.Windows.Thickness( 3 )
            };
  
            ToggleButton.Click += new RoutedEventHandler( ToggleButton_Click );
  
            if ( this.DataMemberBinding != null ) {
                ToggleButton.SetBinding( GridViewToggleButton.IsCheckedProperty, this.DataMemberBinding );
            }
  
            if ( ToggleButtonVisibility != null ) {
                ToggleButton.SetBinding( GridViewToggleButton.VisibilityProperty, ToggleButtonVisibility );
            }
  
            GridViewRow row = cell.ParentRow as GridViewRow;
  
            row.SetBinding( GridViewRow.DetailsVisibilityProperty, new Binding( "IsChecked" ) { 
                Source = ToggleButton, 
                Converter = new BooleanToVisibilityConverter(), 
                Mode = BindingMode.TwoWay 
            } );
  
            return ToggleButton;
        }
  
        void ToggleButton_Click( object sender, RoutedEventArgs e ) {
            RoutedEventArgs newEventArgs = new ToggleRowDetailsColumnRoutedEventArgs( ClickEvent, Cell );
            RaiseEvent( newEventArgs );
        }
    }
  
    public class ToggleRowDetailsColumnRoutedEventArgs : RoutedEventArgs {
  
        public GridViewCell Cell { get; set; }
  
        public GridViewRow Row {
            get { return Cell.ParentRow as GridViewRow; }
        }
  
        public ToggleRowDetailsColumnRoutedEventArgs( RoutedEvent routedEvent, GridViewCell cell )
            : base( routedEvent ) {
            Cell = cell;
        }
    }
  
    public delegate void ToggleRowDetailsColumnRoutedEventHandler( object sender, ToggleRowDetailsColumnRoutedEventArgs e );
}

Tony
Tony
Top achievements
Rank 1
 answered on 16 Apr 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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?