Telerik Forums
UI for WPF Forum
11 answers
306 views
Hello All,

Found another bug in the RadWindow control.  The attached exception is thrown once in a while due to an unchecked conidtion in the WindowHostBase class.

The fix is below but you will have to compile it yourself until they get around to fixing their code product. 

1) In the 'Telerik.Windows.Controls.InternalWindow.WindowHostBase' class you will see the BringToFront method defined as:
public virtual void BringToFront()
{
    // FindIndexToAdd finds an index for a new item, not for old which needs to be moved. That's why we subtract 1.
    var targetIndex = this.FindIndexToAdd() - 1;
    var currentIndex = hosts.IndexOf(this);
 
    if (targetIndex != currentIndex)
    {
        hosts.RemoveAt(currentIndex);
        hosts.Insert(targetIndex, this);
    }
}

replace this function with:
public virtual void BringToFront() {
 
    // FindIndexToAdd finds an index for a new item, not for old which needs to be moved. That's why we subtract 1.
    var targetIndex = this.FindIndexToAdd() - 1;
    var currentIndex = hosts.IndexOf(this);
 
    if (targetIndex != currentIndex && targetIndex > 0) {
        if (currentIndex > 0)
            hosts.RemoveAt(currentIndex);
        hosts.Insert(targetIndex, this);
    }
}

 and the issue goes away.

- Rashad Rivera, Omegus Prime, LLC

Vladi
Telerik team
 answered on 05 Dec 2014
10 answers
226 views
Hi,

I am using the RadSpreadsheet to manipulate a workbook which I exported and stored in a database.

Once imported back from the database I allow the user to modify the workbook. I am detecting when the user makes a change to the content using the WorkbookContentChanged event. If a change is detected I enable my apps save button to allow the user to save the workbook back to the database.

My issue occurs when I try to do things such as rename a worksheet or freeze panes. The WorkbookContentChanged event is not fired and therefore the user will not be given the option by my app to save the workbook back to the database.

Is there another event I can hook up to or is this a bug with the WorkbookContentChanged not firing for some changes?

Thanks
Anthony
Nikolay Demirev
Telerik team
 answered on 05 Dec 2014
1 answer
287 views
When I select a single line(See screenshot 1) and convert into an annotation range using InsertFragment, it is getting inserted.  (See screenshot 2).

But, when I select multiple lines(See screenshot 3), InsertFragment is not working.

Code Sample:

            RadDocument associatedDocument = associatedRichTextBox.Document;
            DocumentSelection selection = associatedDocument.Selection;
            DocumentPosition documentPosition = associatedDocument.CaretPosition;

            string selectedText = GetSelectedText(associatedDocument);

            RadDocument tempDocument = new RadDocument();
            Section section = new Section();
            Paragraph paragraph = new Paragraph();

            try
            {
                //BookmarkRangeStart bookmarkRangeStart = new BookmarkRangeStart();
                //BookmarkRangeEnd bookmarkRangeEnd = new BookmarkRangeEnd();
                //bookmarkRangeEnd.PairWithStart(bookmarkRangeStart);

                //paragraph.Inlines.Add(bookmarkRangeStart);
                //paragraph.Inlines.Add(bookmarkRangeEnd);

                HeadingRangeStart headingRangeStart = new HeadingRangeStart();
                HeadingRangeEnd headingRangeEnd = new HeadingRangeEnd();
                headingRangeEnd.PairWithStart(headingRangeStart);

                Span spanSelectedText = new Span(selectedText.TrimEnd());
                spanSelectedText.FontWeight = FontWeights.Bold;
                spanSelectedText.ForeColor = Colors.Red;

                paragraph.Inlines.Add(headingRangeStart);
                paragraph.Inlines.Add(spanSelectedText);
                paragraph.Inlines.Add(headingRangeEnd);

                section.Blocks.Add(paragraph);
                tempDocument.Sections.Add(section);
                tempDocument.MeasureAndArrangeInDefaultSize();
                tempDocument.Selection.SelectAll();

                associatedRichTextBox.UpdateEditorLayout();
                associatedRichTextBox.InsertFragment(tempDocument.Selection.CopySelectedDocumentElements(true));
                associatedRichTextBox.Document.Selection.Clear();

                associatedRichTextBox.UpdateEditorLayout();
            }

Please suggest a solution.
Svetoslav
Telerik team
 answered on 05 Dec 2014
1 answer
105 views
Dear support,

in Excel the cell format "#.##0,00;-#.##0,00;;@" suppresses values equal zero i.e. no value is displayed in the cell.

This format-string does not work in your spread sheet. Is there another format string to achieve this.

Thanks in advance

Marcus

Tanya
Telerik team
 answered on 05 Dec 2014
1 answer
87 views
Hi ,

I was trying to import the data using RTFFormatProvider.import(string) method.
It is taking so much time to execute this.
The parameter which i was passing has more than 5Lakhs characters.
Do we have any alternative or something else to improve this performance.

Note:I am getting data from the above method but the only thing is taking so much time.

Could you pls throw your thoughts on this.
Todor
Telerik team
 answered on 05 Dec 2014
1 answer
144 views
Hi ,

I was trying to import the data using RTFFormatProvider.import(string) method.
It is taking so much time to execute this.
The parameter which i was passing has more than 5Lakhs characters.
Do we have any alternative or something else to improve this performance.

Note:I am getting data from the above method but the only thing is taking so much time.

Could you pls throw your thoughts on this.
Todor
Telerik team
 answered on 05 Dec 2014
1 answer
135 views
Hello Telerik

I would like to publish some source code examples in my Bog, among other things with Telerik-Controls. But of course I do not want to use the regular Telerik Dlls. Is there a link to download your demo dlls, which you also get when creating a test account.

Greetings Uwe
Dimitrina
Telerik team
 answered on 04 Dec 2014
1 answer
227 views
Hi,

I want to insert a row to a specific index which the user chooses, how can i do it? i see that adding a new row is or in the to or at the button not in the muddle of the grid, 

thanks,
Rachel.
Boris
Telerik team
 answered on 04 Dec 2014
3 answers
288 views
Hello, I want to reference the default template of the MilestoneContainer but I don't achieve this.
the goal is to use the default template and override when a dataTrigger is firing
I try to only define the data trigger
<Style BasedOn="{StaticResource ResourceKey={x:Type telerik:MilestoneContainer}}" TargetType="{x:Type telerik:MilestoneContainer}">

                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Converter={StaticResource ObjectAndTypeToVisibilityConverter}, ConverterParameter={x:Type vm:GanttTaskModelePlanningFamille}}" Value="True">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Rectangle Width="3"
                                                   Height="24"
                                                   Fill="{TemplateBinding Background}" />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
It's no working, trigger have no action
I try to reference the default template in my style definition (to force the trigger)
<Setter Property="Template" Value="{StaticResource MilestoneContainerTemplate}" />
But still not working, the resource is not know
I also try to do reference at resource using the telerik dll, but the import failed (build failed)
<ResourceDictionary Source="pack://application:,,,/Telerik.Windows.Controls.GanttView;component/Telerik.Windows.Controls.GanttView.xaml" /> 

Have you any idea how I can solve my problem ?

Thanks






Masha
Telerik team
 answered on 04 Dec 2014
3 answers
240 views
I came across a strange case when I was writing code for saving FilterDescriptors settings for RadDataFilter. The default value for string filter editor is OperatorValueFilterDescriptorBase.UnsetValue, the FilterDescriptor.Value is equal to OperatorValueFilterDescriptorBase.UnsetValue (FilterDescriptor .Value == OperatorValueFilterDescriptorBase.UnsetValue). When I save and read this value from isolated storage is not equal to OperatorValueFilterDescriptorBase.UnsetValue. See example bellow.

The following example is completely useless but it shows error.

MainWindow.xaml:
<Window x:Class="TestTelerikWpfApp.MainWindow"
        xmlns:local="clr-namespace:TestTelerikWpfApp"
        Title="MainWindow" Height="300">
    <Window.Resources>
    </Window.Resources>
    <StackPanel>
        <TextBox telerik:PersistenceManager.StorageId="textBox" />
        <StackPanel Orientation="Vertical">
            <telerik:RadButton Content="Save" Click="SaveButton_Click" />
            <telerik:RadButton Content="Read" Click="ReadButton_Click" />
        </StackPanel>
    </StackPanel>
</Window>

MainWindow.xaml.cs
namespace TestTelerikWpfApp
{
    using System.Windows;
    using System.Windows.Controls;
    using Telerik.Windows.Persistence.Services;
    using Telerik.Windows.Persistence.Storage;
 
    public partial class MainWindow : Window
    {
        private IsolatedStorageProvider isoProvider;
 
        public MainWindow()
        {
            InitializeComponent();
 
            ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(TextBox), new UnsetValuePropertyProvider());
 
            isoProvider = new IsolatedStorageProvider();
        }
 
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            isoProvider.SaveToStorage();
        }
 
        private void ReadButton_Click(object sender, RoutedEventArgs e)
        {
            isoProvider.LoadFromStorage();
        }
    }
}

For one TextBox I save or read data to isolated storage.

UnsetValuePropertyProvider.cs:
namespace TestTelerikWpfApp
{
    using Telerik.Windows.Data;
    using Telerik.Windows.Persistence.Services;
 
    class UnsetValuePropertyProvider : ICustomPropertyProvider
    {
        public CustomPropertyInfo[] GetCustomProperties()
        {
            return new CustomPropertyInfo[]
            {
                new CustomPropertyInfo("UnsetValue", typeof(UnsetValueProxy))
            };
        }
 
        public void InitializeObject(object context)
        {
        }
 
        public object InitializeValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            return null;
        }
 
        public object ProvideValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            return new UnsetValueProxy() { Value = OperatorValueFilterDescriptorBase.UnsetValue };
        }
 
        public void RestoreValue(CustomPropertyInfo customPropertyInfo, object context, object value)
        {
            var unsetValueProxy = value as UnsetValueProxy;
            var isUnsetValueSame = unsetValueProxy.Value == OperatorValueFilterDescriptorBase.UnsetValue; // isUnsetValueSame = false !!!
        }
    }
}

UnsetValueProxy.cs:
namespace TestTelerikWpfApp
{
    class UnsetValueProxy
    {
        public object Value { get; set; }
    }
}

In ProvideValue method I pass to proxy object OperatorValueFilterDescriptorBase.UnsetValue value and in RestoreValue unsetValueProxy.Value is not equal to OperatorValueFilterDescriptorBase.UnsetValue and it should be. See also locals tab in debug mode (example.png).
Pawel
Top achievements
Rank 1
 answered on 04 Dec 2014
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?