Telerik Forums
UI for WPF Forum
1 answer
99 views
Hi,
I'm using Telerik version 2014.3.1202.40. The MaskedtextInput control in "Masked Input Text Input" Demo has an unexpected behavior.
Here is the configuration I have.
  Mask: (empty)
  Text Mode: MaskedText.
  Input Behavior: Replace
  Selection On Focus: SelectAll
  Update Value Event: LostFocus.

Replication Steps:
1. Type ABC in text input.
2. Select A. Copy A using Ctrl + C.
3. Move cursor after C. Paste using Ctrl + V.

What I expect: ABC becomes ABCA.
Actual result: (empty)

Please fix it! and test before releasing a new version!
It is not the first time that we have the copy-paste error on this control. It is one of the most basic function. 

/Gong
Petar Mladenov
Telerik team
 answered on 18 Dec 2014
3 answers
171 views
Currently we are implementing a scheduleview with a day/week/month view.

day and week view are working without problems. But we are running into problems while working with the month view.

For some reason some appointments are not showing up in the month view. The strange thing that it doesn't seem to be based a maximum number of appointments that can be shown in a month view. sometimes it is the 3th appointment of the day and sometimes the 6th. also it sometimes it is a appointment with a different start and end date but also on occasion one with the same start and end date.

Are there any known issue's on this point or any limits on how many/which appointments are chosen to be displayed in the month view?

regards,
Johan Lollinga
Ideo B.V.
Nasko
Telerik team
 answered on 18 Dec 2014
5 answers
120 views
Hello,

In my application have a TimeLine control with the SelectionMode="Extended", I need to select several items using the CTRL key.
In my scenario when I double click an item I show a window that will present some information related to the clicked item as you can see in the first attached image, I clicked the green item and the window is shown in the center of the screen.
Then when I want to close the window I click the button "Cerrar" (close) and after the window is closed I get the effect as if I clicked and dragged from the first item I clicked to the item behind the window (second attached image).

I wonder if there is a way to disable the range selection when using the SelectionMode="Extended", for my scenario I can't use the SelectionMode="Multiple" because I need to be able to select items using the CTRL key.

Or could you suggest another way to avoid the describes effect?

Thanks in advance,

Alberto
Benjamin
Top achievements
Rank 1
 answered on 18 Dec 2014
2 answers
208 views
Hi,

I would like to modify PopUp template of the RadAutoCompleteBox to have grouped items result, like that:



Group 1
       ItemFound 
       ItemFound 
       ...
Group 2
      ItemFound 
      ItemFound
      ...


Can we do this with the built-in functionalities?
Otherwise, how can i do that? Some clues?

Manuel
Top achievements
Rank 1
 answered on 18 Dec 2014
6 answers
136 views
We are using RadRichTextBox with Default Spell check feature.

We found that SpellCheck could not change incorrect words within Annotation Ranges().

Is there any way to make spellcheck work for annotation ranges.
Tanya
Telerik team
 answered on 18 Dec 2014
1 answer
139 views
In WPF RadRichTextBox, we try to Insert AnnotationRanges using InsertFragment method. But, it throws exception in some scenarios when Track Changes is ON. Please find sample code below.

try
            {
                //Initialize
                RadDocument associatedDocument = associatedRichTextBox.Document;
                DocumentSelection selection = associatedDocument.Selection;
                DocumentPosition documentPosition = associatedDocument.CaretPosition;

                string selectedText = GetSelectedText(associatedDocument);

                // If text is not selected 
                if (String.IsNullOrEmpty(selectedText) && String.IsNullOrWhiteSpace(selectedText))
                {
                    MessageBox.Show("Please select a text", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    RadDocument tempDocument = associatedDocument.Selection.CreateDocumentFromSelection();

                    IEnumerable<FormulaRangeStart> formulaMarkers = tempDocument.GetAnnotationMarkersOfType<FormulaRangeStart>();

                    bool bformulaRangeExistsInSelection = false;
                    foreach (FormulaRangeStart frmla in formulaMarkers)
                    {
                        bformulaRangeExistsInSelection = true;
                        break;
                    }

                    if (bformulaRangeExistsInSelection)
                    {
                        MessageBox.Show("Selection already contains a formula range", "Formula Information", MessageBoxButton.OK, MessageBoxImage.Information);
                        return;
                    }

                    FormulaRangeStart formulaRangeStart = new FormulaRangeStart();
                    FormulaRangeEnd formulaRangeEnd = new FormulaRangeEnd();
                    formulaRangeEnd.PairWithStart(formulaRangeStart);

                    tempDocument.CaretPosition.MoveToFirstPositionInDocument();
                    tempDocument.InsertInline(formulaRangeStart);

                    tempDocument.CaretPosition.MoveToLastPositionInDocument();
                    tempDocument.InsertInline(formulaRangeEnd);

                    tempDocument.Selection.SelectAll();

                    IEnumerable<Paragraph> paragraphs = tempDocument.Selection.GetSelectedParagraphs();

                    foreach (Paragraph paragraph in paragraphs)
                    {
                        foreach (Telerik.Windows.Documents.Model.Inline inline in paragraph.Inlines)
                        {
                            if (inline is Span)
                            {
                                ((Span)(inline)).HighlightColor = Colors.DarkGray;
                            }
                        }
                    }

                    tempDocument.CaretPosition.MoveToLastPositionInDocument();

                    Span spanResetBgColor = new Span(FormattingSymbolLayoutBox.SPACE_SYMBOL_VISUAL);
                    spanResetBgColor.HighlightColor = Colors.White;
                    tempDocument.InsertInline(spanResetBgColor);

                    tempDocument.Selection.SelectAll();

                    associatedRichTextBox.IsTrackChangesEnabled = true;
                    associatedRichTextBox.TrackChangesOptions.TrackFormatting = true;

                    associatedRichTextBox.InsertFragment(tempDocument.Selection.CopySelectedDocumentElements(true));
                    associatedRichTextBox.Insert(FormattingSymbolLayoutBox.ENTER);
                    associatedRichTextBox.Document.Selection.Clear();
                    associatedRichTextBox.UpdateLayout();
                    associatedRichTextBox.UpdateEditorLayout();
                    associatedRichTextBox.Focus();
                    if (associatedRichTextBox.ActiveEditorPresenter != null)
                    {
                        associatedRichTextBox.ActiveEditorPresenter.RecreateUI();
                    }
                }
Todor
Telerik team
 answered on 18 Dec 2014
8 answers
250 views
Hi, I'm testing WPF UI. In the use of themes I get an error message. Error: "LocalizableResourceExtension" is not valid for "Setter.Value".

I have the following code in my Appliaction.xaml:

<Application x:Class="TelerikWpfAppDesignTest.Application"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml"
             >
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes/Windows8/System.Windows.xaml" />
                <ResourceDictionary Source="Themes/Windows8/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="Themes/Windows8/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="Themes/Windows8/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="Themes/Windows8/Telerik.Windows.Controls.RibbonView.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Die benötigten xaml-Files habe ich meinem Projekt hinzugefügt und auch die Verweise sind vorhanden. Was mache ich falsch?
Kalin
Telerik team
 answered on 18 Dec 2014
1 answer
237 views
Hello, I would like to enquire on a solution to the problem as per title. This is my code currently:
for (int i = 0; i < maximumSheet; i++)
            {
                sheet1211.ActiveWorksheet = worksheets[i];
                double scaledWidth = (0.85 / 1366.00) * SystemInformation.VirtualScreen.Width;
                double scaledHeight = (0.85 / 768.00) * SystemInformation.VirtualScreen.Height;
                sheet1211.ActiveSheetEditor.ScaleFactor = new Size(scaledWidth, scaledHeight);
                sheet1211.ActiveSheetEditor.ScrollBarsProvider.HorizontalScrollBar.Visibility = Visibility.Collapsed;
                sheet1211.ActiveSheetEditor.ScrollBarsProvider.VerticalScrollBar.Visibility = Visibility.Collapsed;
            }

The ScaleFactors work across all sheets, but the ScrollBar didn't work for any of the sheets.
Doing just sheet1211.ActiveWorksheet = worksheets[0] and set the ScrollBars visibility works, but that's only 1 sheet, and furthermore if I change to the next sheet and back to worksheet[0] again in runtime by interface, the scrollbars will appear again.

So how do I set the visibility across all sheets just like how I set the ScaleFactor?

Thanks for your attention.

Dexter
Top achievements
Rank 1
 answered on 18 Dec 2014
2 answers
280 views
In my view model I have a byte[] (called "DocumentBytes") that is read from a .docx file.  I have my view set up like this:

<telerik:DocxDataProvider
  x:Name="docxDataProvider"
  Docx="{Binding DocumentBytes, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
  RichTextBox="{Binding ElementName=SnippetPreviewRichTextBox}"
  />
 
<telerik:RadRichTextBox x:Name="SnippetPreviewRichTextBox"/>

The rich textbox correctly displays the document from the file.  When the user makes a change to the content of the rich textbox and then the textbox loses focus, I need the byte[] (DocumentBytes) to be written back with the updated contents of the textbox, and in the docx format, as it was provided to the DocxDataProvider.

Out-of-the-box this didn't seem to work.  I expected the data provider to just write the value back to my property, but it didn't do that.

So, I tried to implement this myself using my view's code behind:
private bool DocumentHasChanged { get; set; }
 
private void SnippetPreviewRichTextBox_GotFocus(object sender, RoutedEventArgs e)
{
  this.DocumentHasChanged = false;
}
 
private void SnippetPreviewRichTextBox_LostFocus(object sender, RoutedEventArgs e)
{
  if (!this.DocumentHasChanged)
    return;
  var viewModel = this.DataContext as SnippetPreviewViewModel;
  if (viewModel == null)
    return;
 
  var formatProvider = new DocxFormatProvider();
  var docXBytes = formatProvider.Export(this.SnippetPreviewRichTextBox.Document);
  viewModel.DocumentBytes = docXBytes;
}
 
private void SnippetPreviewRichTextBox_DocumentContentChanged(object sender, EventArgs e)
{
  this.DocumentHasChanged = true;
}


This caused problems and threw exceptions when I would edit the document's content in the rich textbox, and then click on back on it (the LostFocus event was firing each time I clicked on the rich textbox).

I'm really surprised there isn't a short and concise example in the WPF documentation on this, and it's something I imagine most people have to do.  Perhaps the documentation is there and I just haven't found it.

So, what I'm looking for is a example of how to actually bind a byte[] from my view model, and get the view to write back to that same property when the rich textbox's content is updated.
Nathan
Top achievements
Rank 1
 answered on 17 Dec 2014
2 answers
223 views
After exporting a RadSpreadsheet workbook to xlsx format using XlsxFormatProvider, resulting Excel workbook opens within Excel and basic functions seem OK.  However, other simple Excel functions cause Excel to loop.  For example, right-click and select of "Format Cells ..." causes this loop behavior.

I am using runtime UI for WPF version v4.0.30319 and Office 2010.

Thank you!
-----------
namespace Xxxxx.Model

    public class ExcelService : IExcelService
    {
        private XlsxFormatProvider xlsxFormatProvider;        public ExcelService()
        {
            xlsxFormatProvider = new XlsxFormatProvider();
            WorkbookFormatProvidersManager.RegisterFormatProvider(xlsxFormatProvider);
        }

        public Workbook CreateWorkbook()
        {
            return new Workbook();
        }       

        public bool AddWorksheet(Workbook workbook, string sheetName, DataTable table)
        {
            int row;
            int col;           

            Worksheet worksheet = workbook.Worksheets.Add();
            worksheet.Name = sheetName;            
            col = 0;
            foreach (DataColumn tableColumn in table.Columns)
            {
                worksheet.Cells[0, col].SetValue(tableColumn.Caption);
                col++;
            }            

            row = 1;
            foreach (DataRow tableRow in table.Rows)
            {
                col = 0;
                foreach (DataColumn tableColumn in table.Columns)
                {
                    worksheet.Cells[row, col].SetValue(tableRow[tableColumn].ToString());
                    //worksheet.Cells[row, col].SetFormat(new CellValueFormat("@"));
                    col++;
                }
                row++;
            }
            return true;
        }       

        public bool ExportWorkbook(Workbook workbook)
        {
            var dialog = new Microsoft.Win32.SaveFileDialog();
            dialog.DefaultExt = "*.xlsx";
            dialog.Filter = "Excel Workbook (*.xlsx)|*.xlsx";           
            if (dialog.ShowDialog() == true)
            {
                using (Stream output = dialog.OpenFile())
                {
                    xlsxFormatProvider.Export(workbook, output);
                }
            }
            return true;
        }
    }
}


Bob
Top achievements
Rank 1
 answered on 17 Dec 2014
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?