Telerik Forums
UI for WPF Forum
4 answers
95 views
Hi Team,

                I have placed a combo box in a view and inside Rad Pane. Both combo box item source are same. But combo box inside Rad Pane is not supporting Internationalization. To test I18N I used Japanease machine. In Japanease machine '\' is considered as '¥' symbol.

                I have attached a screen shot. Please let me know the solution.
Vladi
Telerik team
 answered on 11 Apr 2014
5 answers
204 views
Hi,

I have a table that uses read only ranges for the first cell in each column and row to prevent user input. I have an issue with the tab stopping not entering the last cell of each row but if I tab again it tabs to the next row. This is due to starting my read only ranges in these cells in order to make the first cell in each row completely non-editable, if I remove them it works fine.

Is there any way to bring the tab stop back to these cells or an alternative solution to making my headers read only?

Here's the code I'm using to generate the table using two string arrays for the definition:

01.Table table = new Table();
02.table.StyleName = RadDocumentDefaultStyles.DefaultTableGridStyleName;
03.TableRow headerRow = new TableRow();
04.TableCell cornerCell = new TableCell();
05. 
06.Paragraph readOnlyPara = new Paragraph();
07.ReadOnlyRangeStart range = new ReadOnlyRangeStart();
08.range.AnnotationID = 1;
09.readOnlyPara.Inlines.Add(range);
10.cornercell.Blocks.Add(readOnlyPara);
11.cornerCell.Background = Colors.LightGray;
12.headerRow.Cells.Add(cornerCell);
13.table.AddRow(headerRow);
14. 
15.//Add the column headers, which are an array of strings
16.foreach (string header in headers)
17.{
18.    TableCell cell = new TableCell();
19.    cell.Background = Colors.LightGray;
20.    Paragraph p = new Paragraph();
21.    Span text;
22. 
23.    //telerik paragraph cannot take empty span
24.    if(String.IsNullOrEmpty(header))
25.        text = new Span(" ");
26.    else
27.        text = new Span(header);
28.    text.FontWeight = FontWeights.Bold;
29. 
30.    p.Inlines.Add(text);
31.    cell.Blocks.Add(p);
32.    headerRow.Cells.Add(cell);
33.}
34. 
35.//questions are an array of strings
36.for (int i = 0; i < questions.Length; i++)
37.{
38.    //Add the first cell of each Row
39.    string question = questions[i];
40.    TableRow row = new TableRow();
41.    TableCell cell = new TableCell();
42.    cell.Background = Colors.LightGray;
43.    Paragraph p = new Paragraph();
44. 
45.    Span text = new Span(question);
46.    text.FontWeight = FontWeights.Bold;
47. 
48.    p.Inlines.Add(text);
49.    cell.Blocks.Add(p);
50.    row.Cells.Add(cell);
51. 
52.    //Add the remaining cells of the row for each header
53.    for (int y = 0; y < headers.Length; y++)
54.    {
55.        string header = headers[y];
56.        TableCell answerCell = new TableCell();
57.        Paragraph answerP = new Paragraph();
58.        //End the read only at the start of each answering row
59.        if (y == 0)
60.        {
61.            ReadOnlyRangeEnd rangeEnd = new ReadOnlyRangeEnd();
62.            rangeEnd.AnnotationID = i + 1;
63.            answerP.Inlines.Add(rangeEnd);
64.        }
65. 
66.        //Start the read only range at the end of the answering row.
67.        if (y == headers.Length - 1 && i != questions.Length - 1)
68.        {
69.            ReadOnlyRangeStart rangestart = new ReadOnlyRangeStart();
70.            rangestart.AnnotationID = (i + 2);
71.            answerP.Inlines.Add(rangestart);
72.        }
73. 
74.        answerCell.Blocks.Add(answerP);
75.        row.Cells.Add(answerCell);
76.    }
77. 
78.    table.AddRow(row);
79.}
80. 
81.section.Blocks.Add(table);

Many Thanks,
Chris

Boby
Telerik team
 answered on 11 Apr 2014
3 answers
135 views
Hi,

I am looking for a way to get a TimePicker which looks like the standard one with spinbuttons to increase/decrease time.
Does Telerik provide this?
If not, how can this be achieved?

Of course I could build my own from scratch, but I expect this is not neccessary with a library like this.

Best Regards, Matthias
Konstantina
Telerik team
 answered on 11 Apr 2014
3 answers
168 views
I have a WPF application with GridView which has a button for each row:
<telerik:RadGridView x:Name="radGridView" Margin="8" ItemsSource="{Binding Quotes, Mode=TwoWay}" ShowGroupPanel="False" AutoGenerateColumns="False" Height="250">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Download Quote"></Button>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding QuoteId}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ProductModelId}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding TechnicalPrice}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ModelPrice}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>

After using record and playback of actions to click the button, when replaying back the test, I get an error in regards to "Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: "
Is GridView supported even?
According to this page, it should have been by now http://www.telerik.com/help/wpf/coded-ui-support.html

Is RadGridView able to support Coded UI Testing and any suggestions on how to fix it?



Full error:
Test Name: CodedUITestMethod1
Test FullName: CodedUITestConcepts.CodedUITest3.CodedUITestMethod1
Test Source: c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\CodedUITest3.cs : line 27
Test Outcome: Failed
Test Duration: 0:01:44.527071Result Message:
Test method CodedUITestConcepts.CodedUITest3.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'UIA'
ControlType: 'Cell'
ColumnHeader: ' '
AutomationId: 'Cell_0_0'
Search may have failed at 'Test List' Tree as it may have virtualized children. If the control being searched is descendant of 'Test List' Tree then including it as the parent container may solve the problem. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
Result StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetUITestControlRecursive(Boolean useCache, Boolean alwaysSearch, ISearchArgument searchArg, IList`1 windowTitles, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<Find>b__d()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Find()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyPrivate(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass11.<GetProperty>b__10()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.ALUtility.GetTechElementFromUITestControl(UITestControl uiTestControl)
at Microsoft.VisualStudio.TestTools.UITesting.ActionExecutorManager.GetActionExecutor(UITestControl uiControl)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementation(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.<>c__DisplayClass6.<Click>b__5()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, Point relativeCoordinate)
at CodedUITestConcepts.UIMap.DownloadQuote() in c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\UIMap.Designer.cs:line 91
at CodedUITestConcepts.CodedUITest3.CodedUITestMethod1() in c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\CodedUITest3.cs:line 30
Yordanka
Telerik team
 answered on 11 Apr 2014
3 answers
176 views
I want to print two pages per sheet .Because I have one GridView and only three columns are available in the GridView. So remaining part of the page are unuseful.
so that I set  PrintDialog.PrintTicket.PagesPerSheet = 2 and PrintDialog.PrintQueue.DefaultPrintTicket.PagesPerSheet = 2. But its not working. And I am using following code for the Printing.

public static void Print(this GridViewDataControl source, bool showDialog, bool p_IsLandscape = true)
        {
            try
            {
                PrintDialog _PrintDialog = new PrintDialog();
                _PrintDialog.PrintQueue = LocalPrintServer.GetDefaultPrintQueue();
                _PrintDialog.PrintTicket = _PrintDialog.PrintQueue.DefaultPrintTicket;
              
                if (p_IsLandscape)
                    _PrintDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;
                else
                {
                    _PrintDialog.PrintTicket.PageOrientation = PageOrientation.Portrait;
                    _PrintDialog.PrintTicket.PagesPerSheet = 2;
                    _PrintDialog.PrintQueue.DefaultPrintTicket.PagesPerSheet = 2;
                }

                bool? dialogResult = showDialog ? _PrintDialog.ShowDialog() : true;

                if (dialogResult == true)
                {
                    DocumentViewer viewer = new DocumentViewer();
                    viewer.Document = ToFixedDocument(ToPrintFriendlyGrid(source), _PrintDialog);
                    _PrintDialog.PrintDocument(viewer.Document.DocumentPaginator, null);
                }
            }
            catch
            {
                   throw _Exception;
            }
        }

static FixedDocument ToFixedDocument(FrameworkElement element, PrintDialog dialog)
        {
            PrintCapabilities capabilities = dialog.PrintQueue.GetPrintCapabilities(dialog.PrintTicket);
            FixedDocument fixedDocument = new FixedDocument();

            element.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));

            Size pageSize = new Size(element.DesiredSize.Width, dialog.PrintableAreaHeight);
            Size extentSize = new Size(element.DesiredSize.Width, capabilities.PageImageableArea.ExtentHeight);

            double totalHeight = element.DesiredSize.Height;
            double totalWidth = element.DesiredSize.Width;
            double yOffset = 0d;

            if (totalWidth < dialog.PrintableAreaWidth)
            {
                Size _Size = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight);
                element.Arrange(new Rect(new Point(0, 0), _Size));
            }
            else
            {
                element.Arrange(new Rect(new Point(0, 0), element.DesiredSize));
            }

            while (yOffset < totalHeight)
            {
                VisualBrush brush = new VisualBrush(element);
                brush.Stretch = Stretch.None;
                brush.AlignmentX = AlignmentX.Left;
                brush.AlignmentY = AlignmentY.Top;
                brush.ViewboxUnits = BrushMappingMode.Absolute;
                brush.TileMode = TileMode.None;
                if (totalWidth < dialog.PrintableAreaWidth)
                    brush.Viewbox = new Rect(0, yOffset, dialog.PrintableAreaWidth, extentSize.Height);
                else
                    brush.Viewbox = new Rect(0, yOffset, extentSize.Width, extentSize.Height);

                PageContent pageContent = new PageContent();
                FixedPage page = new FixedPage();
                ((IAddChild)pageContent).AddChild(page);

                fixedDocument.Pages.Add(pageContent);

                if (totalWidth < dialog.PrintableAreaWidth)
                    page.Width = dialog.PrintableAreaWidth;
                else
                    page.Width = totalWidth;

                page.Height = pageSize.Height;

                Canvas canvas = new Canvas();
                FixedPage.SetLeft(canvas, capabilities.PageImageableArea.OriginWidth);
                FixedPage.SetTop(canvas, capabilities.PageImageableArea.OriginHeight);

                if (totalWidth < dialog.PrintableAreaWidth)
                    canvas.Width = dialog.PrintableAreaWidth;
                else
                    canvas.Width = extentSize.Width;

                canvas.Height = extentSize.Height;
                canvas.Background = brush;

                page.Children.Add(canvas);

                yOffset += extentSize.Height;
            }
            return fixedDocument;
        }

Can you help

Thanks
Petya
Telerik team
 answered on 10 Apr 2014
1 answer
101 views
I have a gridview which has 4,100 rows and 30 columns. If I scroll the grid to the right (in other words so I can see columns 18 thru 30) and then choose to filter on one of those columns, the default filter dialog pops up as expected. However as soon as I select a value in the pop-up dialog the grid immediately scrolls to the left, the dialog stays visible but 'empties'. I then scroll the grid to the right and the filter has been applied as expected. If I filter on a column that is visible initially (i.e. columns 1 thru 17) then this problem does not exist, Is this behavior by design and if so how do I turn it off or if it is a problem is their a work around or fix available. Please advise - thanks
Dimitrina
Telerik team
 answered on 10 Apr 2014
2 answers
147 views
Hello!

I have been fighting with this for a day now, and I'm running out of fuel. My main form has a Toolbars-collection containing ToolbarViewModels having properties like Band and BandIndex to bind to. I use the following xaml for my main form:

        <telerik:RadToolBarTray
               Name="Toolbars"
               Grid.Row="1"
               ItemsSource="{Binding Path=Toolbars}"
               IsLocked="False"
            >

            <telerik:RadToolBarTray.ItemTemplate>
                <DataTemplate>
                    <telerik:RadToolBar 
                        Band="{Binding Path=Band}"
                        BandIndex="{Binding Path=BandIndex}"
                        ItemsSource="{Binding Path=Elements}"
                          >
                        <telerik:RadToolBar.ItemTemplate>
                            <DataTemplate>

                             ...this part works, as the toolbars have content

                            </DataTemplate>
                        </telerik:RadToolBar.ItemTemplate>
                    </telerik:RadToolBar>
                </DataTemplate>
            </telerik:RadToolBarTray.ItemTemplate>
        </telerik:RadToolBarTray>

As far as I can see, this should work. But what happens is that the last toolbar added to the Toolbars-collection is the topmost, and all other ones end up underneath it & invisible, stacked on top of each other in "Z-order". So in effect what doesn't seem to work is the BandIndex. The BandIndex getter of the view model is also accessed when the toolbar is added.

I have tried different alignment and content alignment combinations, but all toolbars still end up in the same place.

Any help appreciated,

Kim Johnsson
Kim
Top achievements
Rank 1
 answered on 10 Apr 2014
3 answers
91 views
Hello,

I am binding the ItemsSource of a ScatterLineSeries to some Linq Enumerable.
Is it possible to use the index (and not some property inside of the item) as x-coordinate?

Additionally, is it possible to specify a dot-separated path inside the XValueBinding (e.g. XValueBinding="Parent.X1")?

Thank you in advance!

Alex
Petar Marchev
Telerik team
 answered on 10 Apr 2014
1 answer
347 views
I have a RadGridView bound via the ItemsSource property to an QueryableCollectionView which is exposed as an IEnumerable property in a ViewModel. This ViewModel is the contents of a TabControl (RadTabControl).

The tab contorl does not persist the visual tree when the tabs are changed (as expected), but because I'm using QueryableCollectionView the view state of the grid is persisted.

When I go back to the original tab any filtering is reapplied as expected (great!) but the the inidividual column filters haven't been updated - the filter icon in the column header has not changed colour and importantly the column filters UI does not show all filtering possiblities.

Can some explain how I can get the grid to display correctly when it is re-bound to a QueryableCollectionView which has FilterDescriptors already defined?


Cheers

Ollie Riches
Dimitrina
Telerik team
 answered on 10 Apr 2014
7 answers
239 views
Hello
     We've noticed on our application that showing a grid for large collections causese the application to use huge ammount of memory and throw OutOfMemory exception.

We've created a demo project cotaining 5 million enties containing two string.
Creating the data context raised memory consumption of the application to 450MB.
Showing the window containing the RadGridView raised memory consumption to 800MB.
All grid rows are set, no infinity/auto exists.

Any ideas?
Dimitrina
Telerik team
 answered on 10 Apr 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
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
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?