Telerik Forums
UI for WPF Forum
1 answer
132 views
Hi all,

I am just starting to implement zoom/scrolling for my RadChart. However, I am running into the problem where my X axis data type is DateTime, thus when I add ZoomScrollSettingsX it gave me "Cannot convert from Double to DateTime" error. Can someone get me started on creating a custom ZoomScrollSettings?

Much appreciated,
Jin
Rosko
Telerik team
 answered on 07 Aug 2012
1 answer
81 views
A while ago I built a custom Filtering Control for a boolean column based upon this article http://www.telerik.com/help/wpf/gridview-filtering-custom-filtering-controls.html (Shown in BeforeUpdate.png).  It worked fine in version 2012.1.326.40. I have recently updated our version to 2012.2.725.40 and it now shows as AfterUpdate.png. the code I have in the method that Implement IFilteringControl.Prepare does get hit when the control is shown, it just is showing what looks to be the default filtering control and not my custom one.

I have used Style Templates for almost every part of the RadGridView, is there one I just need to update or something? Just not sure how to fix the issue since all i did was update to your latest Telerik version. Was there something that was changed which disabled custom Filter controls?
Yordanka
Telerik team
 answered on 07 Aug 2012
3 answers
305 views
How do I set the time line to vertical orientation? I want to display the items in columns and the time intervals should be rows, like the ScheduleView.
Tsvetie
Telerik team
 answered on 07 Aug 2012
7 answers
227 views
I just updated to version 2012.2.607.40 today and now when I switch to design view in WPF I get the following exception:

Cannot locate resource 'themes/genericmetrotouch.xaml'.
   at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.get_ContentType()
   at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response)
   at MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType)
   at System.Windows.ResourceDictionary.set_Source(Uri value)
   at System.Windows.Baml2006.WpfSharedBamlSchemaContext.<Create_BamlProperty_ResourceDictionary_Source>b__1c4(Object target, Object value)
   at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)

Tina Stancheva
Telerik team
 answered on 07 Aug 2012
0 answers
130 views
Edit:
Here is the solution:

<telerik:GridViewComboBoxColumn Header="Location"
                                    DataMemberBinding="{Binding LocationId}"
                                    UniqueName="LocationId"
                                    ItemsSourceBinding="{Binding Path=Locations,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
                                    SelectedValueMemberPath="Id"
                                    DisplayMemberPath="Name" />


I am evaluating the GridView and have ran into an issue binding the domain data which represents each row  to the ComboBox in the GridView using MVVM.  The GridView  is populated with Employees.  Each employees (Employee class) has a list of locations (Locations property on the Employee class) and a SelectedLocationId.  These locations will fill the combobox in a column in the GridView.  So for example, I have two employees, each bound to the Grid:

public class MyViewModel{
 
    public BindingList<Employee> Employees { //The grid binds to this list}
}
 
public class Employee{
    public string Name{...}
    public int SelectedLocationId {...}
    public BindingList<Location> Locations {...} //Binds to combobox in grid.
//Location class has Name and Id property
}


The data:
Joe
Locations: US, Canada
SelectedLocation: Canada
Bob
Locations: US, Mexico
SelectedLocation: Mexico

One of the columns in the grid should be "Location" with a combobox column which has the respective data for each employee.  I tried this in the GridView:

     
<telerik:GridViewComboBoxColumn Header="Location"
                              ItemsSource="{Binding Path=Locations, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:GridViewRow}}"
                              DisplayMemberPath="Name"
                              FocusVisualStyle="{x:Null}"
                      SelectedValueMemberPath="Id">

However, I see in the output, that the Combobox is trying to bind to the ViewModel instead of the domain entity Employee.  How can I bind a combobox in the grid to a list on the domain entity in each row?

Thanks for your help!
+++AAA+__WOULD BUY AGAIN ++++
Top achievements
Rank 1
 asked on 06 Aug 2012
2 answers
162 views
I'm having problems with the header on my RadDocument.  I've attached an image of what is occurring.  The header has two paragraphs, the first showing the page fields and the second spans mimicking column headers for the table in the document.  The first time the document is displayed, the content for the two paragraphs is switched.  After paging, it is corrected.  The switch will also come back if I maximize the window.  Below is the code that creates the header document....
private RadDocument CreateHeaderDocument(List<GridViewBoundColumnBase> columns)
{
    RadDocument document = new RadDocument();
    Section section = new Section();
    Paragraph paragraph = new Paragraph();
    paragraph.FontSize = fontSize;
    PageField pageField = new PageField()
    {
        DisplayMode = FieldDisplayMode.Result
    };
    FieldRangeStart pageFieldStart = new FieldRangeStart();
    pageFieldStart.Field = pageField;
    FieldRangeEnd pageFieldEnd = new FieldRangeEnd();
    pageFieldEnd.Start = pageFieldStart;
    paragraph.Inlines.Add(pageFieldStart);
    paragraph.Inlines.Add(pageFieldEnd);
    FieldRangeStart numPagesFieldStart = new FieldRangeStart();
    numPagesFieldStart.Field = new NumPagesField()
    {
        DisplayMode = FieldDisplayMode.Result
    };
    FieldRangeEnd numPagesFieldEnd = new FieldRangeEnd();
    numPagesFieldEnd.Start = numPagesFieldStart;
    var ofSpan = new Span(" of ");
    ofSpan.FontFamily = fontFamily;
    ofSpan.FontSize = fontSize;
    ofSpan.FontWeight = FontWeights.Bold;
    ofSpan.ForeColor = Color.FromArgb(255, 0, 0, 0);
    paragraph.Inlines.Add(ofSpan);
    paragraph.Inlines.Add(numPagesFieldStart);
    paragraph.Inlines.Add(numPagesFieldEnd);
    section.Blocks.Add(paragraph);
    var hdrPara = new Telerik.Windows.Documents.Model.Paragraph();
    hdrPara.Background = _headerBackground;
    var spaceWidth = GetScreenSize("i", fontFamily, fontSize, FontWeights.Bold, FontStyles.Normal, FontStretches.Normal).Width;
    foreach (GridViewBoundColumnBase col in columns)
    {
        String s = String.Empty;
        if (col.Header != null)
        {
            s = col.Header as String;
        }
        var span = new Telerik.Windows.Documents.Model.Span(s);
        span.FontFamily = fontFamily;
        span.FontSize = fontSize;
        span.FontWeight = FontWeights.Bold;
        span.ForeColor = Color.FromArgb(255, 0, 0, 0);
        var hdrWidth = GetScreenSize(span.Text, span.FontFamily, span.FontSize, span.FontWeight, FontStyles.Normal, FontStretches.Normal).Width;
        var spaces = (col.ActualWidth - hdrWidth) / spaceWidth;
        for (int i = 0; i < spaces; i++)
        {
            span.Text += " ";
        }
        hdrPara.Inlines.Add(span);
    }
    section.Blocks.Add(hdrPara);
    document.Sections.Add(section);
    return document;
}

Please advise, as this is definitely a show stopper,
Thanks,
Steve



P.S. I also am curious as to why all the text in the header is gray; even when explictly setting the color to black. 






Iva Toteva
Telerik team
 answered on 06 Aug 2012
4 answers
256 views
Is there are built-in way to have a 'close all' option appear in the RadTabControl's drop-down menu? We have a close button on each tab, but it would be nice to also have an option in the drop down to close everything out.

Can this also be easily done in a context menu?
Alex Fidanov
Telerik team
 answered on 06 Aug 2012
5 answers
161 views
After updating to the 2012.2 version I have problems with the RadRichTextBox.
When running my application it fails:

Exception: Object reference not set to an instance of an object.
Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter
ClearPresenterUI

Source: Telerik.Windows.Documents
Target: Void ClearPresenterUI()
Stacktrace:    at Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.ClearPresenterUI()
   at Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.DoOnDocumentChanging()
   at Telerik.Windows.Controls.RadRichTextBox.set_Document(RadDocument value)
   at Telerik.Windows.Documents.FormatProviders.DataProviderBase.UpdateDocument()
   at Telerik.Windows.Documents.FormatProviders.DataProviderBase.StringPropertyChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
....

Iva Toteva
Telerik team
 answered on 06 Aug 2012
3 answers
545 views
Hello. I'm see differences in formatting using a VirtualizingWrapPanel vs using a standard WrapPanel.

Here is the xaml:

<Window x:Class="GalleryView3.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        Title="MainWindow" Height="350" Width="525" MinWidth="350">
    <Grid>
        <Border BorderThickness="3" MinWidth="100" MinHeight="100">
        <ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Name="TabGalleryListView" ItemsSource="{Binding Source}" SelectionChanged="SelectionChanged">
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                        <telerik:VirtualizingWrapPanel IsItemsHost="True" Orientation="Horizontal" />
                        <!--<WrapPanel IsItemsHost="True" Orientation="Horizontal" />-->
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Margin="10,10,10,10" Orientation="Vertical">
                        <Border BorderThickness="3" BorderBrush="Black">
                            <Image Width="128" Height="128" Source="{Binding ImageSource}" Stretch="Uniform" />
                        </Border>
                        <StackPanel Orientation="Horizontal" Margin="0,10,0,0" >
                            <CheckBox Margin="0,0,5,0" VerticalAlignment="Center"/>
                            <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Text="{Binding DisplayText}" Foreground="Red"/>
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        </Border>
    </Grid>
</Window>

You'll see where I've been commenting in/out the standard WrapPanel & the VirtualizingWrapPanel.

When I run with the WrapPanel enabled, and VWP commented out, I get the desired effect, a nice bunch of the same graphic with checkbox & text following. (first attached illustration)

When I run with the VWP enabled, and WrapPanel commented out, the image is not properly resized and the checkbox & text are clipped. (second attached illustration).

I'm thinking that they should both work the same! Hopefully you can tell me where I am going wrong.
My Telerik.Windows.Controls.dll version is 2012.2.607.40

Thanks!
Mark

mark
Top achievements
Rank 1
 answered on 06 Aug 2012
3 answers
129 views

Hi,

We had a RadGrid on a form and we are changing cell background of cells manually depending on values in the cells. ANd it works fine but when we scroll down and then back to up then applied colors are meshed up and applied incorrectly
We are using 2011.2.920.40 version of WPF controls.

Thanks

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