Telerik Forums
UI for WPF Forum
1 answer
273 views
I have a RadGridView bound to a collection of ObservableCollection<Foo>. I am trying to bind a Command from the view model to a RadContextMenu, but it would seem that no matter how you describe the RelativeSource to the DataContext, the RadContextMenu is only taking its binding from the ItemsSource of the RadGridView. The routing worked perfectly well in the past using ContextMenu.MenuItem and using the hack of binding to the PlacementTarget.Tag, but no longer works when I changed from MenuItem to RadMenuItem (which are much nicer). I have had to resort to RadMenuItem_Click since I can find no way of getting the binding to work.

<Controls:RadGridView ShowGroupPanel="False"
                                  Grid.Row="1"
                                  x:Name="radGridView"
                                  DockPanel.Dock="Top"
                                  DataContext="{Binding}"
                                  d:DataContext="{d:DesignData Source=../../DesignData/SampleBinderCollection.xaml}"
                                  ItemsSource="{Binding}"
                                  AutoGenerateColumns="False"
                                  IsSynchronizedWithCurrentItem="True"
                                  SelectedItem="{Binding DataContext.SelectedBinder,Mode=TwoWay, RelativeSource={RelativeSource AncestorType=Window}}"
                                  IsReadOnly="True"
                                  Tag="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext}"
                                  FrozenColumnCount="5"
                                  ShowColumnFooters="True"
                                  DataContextChanged="RadGridView_OnDataContextChanged">
                <Controls1:RadContextMenu.ContextMenu>
                    <Controls1:RadContextMenu>
                        <Controls1:RadMenuItem Header="Go to this invoice/transaction"
                                  Command="{Binding DataContext.OpenTransactionWindowFromInvoiceCommand, RelativeSource={RelativeSource AncestorType=Window}}"
                                               Click="RadMenuItem_Click">
                            <Controls1:RadMenuItem.Icon>
                                <Image Source="/Cornhouse;component/Images/NewCardHS.png"
                                       Width="16"
                                       Height="16" />
                            </Controls1:RadMenuItem.Icon>
                        </Controls1:RadMenuItem>
                     </Controls1:RadContextMenu>
                </Controls1:RadContextMenu.ContextMenu>
 
etc ....
 
The viemodel is simply
public class MyViewModel:INotifyPropertyChanged
{
    public ICommand OpenTransactionWindowFromInvoiceCommand {get etc}
    public ObservableCollection<Foo> Collection
     { 
       get{return _collection;}
       set{
_collection=value;
           RaisePropertyChanged("Collection");
}           
}

I would really appreciate some help with this.

Many thanks
Jeremy
Konstantina
Telerik team
 answered on 08 Dec 2010
1 answer
111 views
I am using the tileview and would like to know if the following is possible.

When a tileviewitem is the large tile on the screen (i.e. the other tileviews are all to the right), I want it to have a particular content regardless of how big the tileviewitem is. So if the user makes the application window really small, I don't want the tileviewitem in the large tile to change its content based on the size. I want its contents to remain constant unless it is minimized to the right.

Thanks,

Billy Jacobs
Tina Stancheva
Telerik team
 answered on 07 Dec 2010
3 answers
280 views
I am binding my RadGridView's ItemsSource to a System.Data.DataSet.  This dataset is readonly and is not interpreted by my application...  it's just obtained and displayed for the user to view.  It comes from a web service and the idea is that this web service may change the contents being served up in the future.  The number of columns in the dataset may change down the road.

There is one important exception to this.  Once my application obtains the dataset from the web service, it adds a column onto it and populates it with objects of a complex type.
In my gridview, I'd like to display these objects with much more than just the default ToString.
I'd like to use a DataTemplate to do this.

I see the GridViewDataColumn's CellTemplate.  But I'm not defining GridViewDataColumns in my RadGridView, because, as I mentioned, I'm binding the GridView's ItemsSource to my DataSet.  So, at least at first glance, that doesn't seem useful to me.

In addition, I'm using the MVVM application model.  So although I'm tempted to drop the binding to the ItemSource, manually add a GridViewDataColumn for each of my columns, and set the CellTemplate on my special column, I'm resisting the urge.  Ideally I can do this all with binding.

How can I apply a DataTemplate to my cells while still binding to ItemsSource?

I wish I could specify a CellTemplateSelector for the entire GridView.  Then I'd just apply a special template when the cell contained an object of my type.

Thanks for any help.
Buzz



Maya
Telerik team
 answered on 07 Dec 2010
4 answers
568 views
It looks like a bug in System.Windows.DataTemplate, but I thought I'd ask here if you know a way around this bug:

Assigning a ToolTipTemplate to an InformationLater requires that you pass it a DataTemplate (of course - for binding), but the DataTemplate tip does not support CornerRadius (it seems broken).

<DataTemplate x:Key="CustomToolTipDataTemplate">
    <Border BorderBrush="Black" BorderThickness="2" CornerRadius="6" Background="#FDF2D4" MaxWidth="300">
        <Grid Margin="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="14" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" FontWeight="Bold" FontFamily="Trebuchet MS" FontSize="12" Text="{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='NAME', StringFormat=County: {0}}" />
            <TextBlock Grid.Row="1" FontWeight="Bold" FontFamily="Trebuchet MS" FontSize="10" Text="{Binding Converter={StaticResource ExtendedDataConverter}, ConverterParameter='PAT_EST', StringFormat='Paternity Establishment Percentage: {0:0.##}'}" />
            <TextBlock Grid.Row="2" FontFamily="Trebuchet MS" FontSize="10" Text="Percent of Cases with Orders: 87" />
            <TextBlock Grid.Row="3" FontFamily="Trebuchet MS" FontSize="10" Text="Percent of Current Collected: 91" />
            <TextBlock Grid.Row="4" FontFamily="Trebuchet MS" FontSize="10" Text="Percent of Cases Paying Arrears: 84" />
            <TextBlock Grid.Row="5" FontFamily="Trebuchet MS" FontSize="10" Text="Medical Support Ratio: 74" />
            <TextBlock Grid.Row="6" FontFamily="Trebuchet MS" FontSize="10" Text="Cost Effectiveness Ratio: 96" />
        </Grid>
    </Border>
</DataTemplate>
 
However, if I omit ToolTipTemplate and use ToolTipservice to specify this and call a ControlTemplate for the tip, CornerRadius works fine!

<ToolTipService.ToolTip>
    <ToolTip Template="{StaticResource ToolTipTemplateXX}" HasDropShadow="True">
        <ToolTip.Content>
            <TextBlock
                Text="This is a test"
                FontFamily="Georgia" FontSize="14" TextWrapping="Wrap"/>
        </ToolTip.Content>
    </ToolTip>
</ToolTipService.ToolTip>

<ControlTemplate x:Key="ToolTipTemplateXX">
    <Border BorderBrush="Black" BorderThickness="2" CornerRadius="6" Background="#FDF2D4" MaxWidth="300">
        <Grid Margin="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="14" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
                <RowDefinition Height="12" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" FontWeight="Bold" FontFamily="Trebuchet MS" FontSize="12" Text="County: Centre" />
            <TextBlock Grid.Row="1" FontWeight="Bold" FontFamily="Trebuchet MS" FontSize="10" Text="Paternity Establishment Percentage: 98" />
            <TextBlock Grid.Row="2" FontFamily="Trebuchet MS" FontSize="10" Text="Percent of Cases with Orders: 87" />
            <TextBlock Grid.Row="3" FontFamily="Trebuchet MS" FontSize="10" Text="Percent of Current Collected: 91" />
            <TextBlock Grid.Row="4" FontFamily="Trebuchet MS" FontSize="10" Text="Percent of Cases Paying Arrears: 84" />
            <TextBlock Grid.Row="5" FontFamily="Trebuchet MS" FontSize="10" Text="Medical Support Ratio: 74" />
            <TextBlock Grid.Row="6" FontFamily="Trebuchet MS" FontSize="10" Text="Cost Effectiveness Ratio: 96" />
        </Grid>
    </Border>
</ControlTemplate>

Any idea why this is or how to work around it easily?

Thanks!
James
Top achievements
Rank 1
 answered on 07 Dec 2010
1 answer
77 views

Hi,

I am trying to automate the controls in subject. The site below tells me UI automation for these controls are not supported for wpf applications. Is there an update/recommended solution regarding the same that I can leverage for my UI automation? It may save me a lot of time :)!

http://www.telerik.com/help/silverlight/ui_automation_support.html

 


More information on my work around and where I am stuck:

  1. DateTimePicker control

Please see attached image for reference. Using UI Spy I can actually see the window and  all of its content for the “date” control. The automation ids are missing, but at least I see the “window” control exposed and the ‘text’ names that I can actually use in my helper function to get/set a specified date.

However, the clock portion of it is hidden from UI spy. I don’t know if this is another window control or something that is just embedded in the date window? Any ideas on how I can access the clock window?

 

  1. RowDetails control

This is not exposed at all in UI Spy L! I am thinking of a work around that I have not yet tested but before I invest time in it, I was wondering if you have a recommended solution that I can use?

 


Thank you for your help and time,

Harleen

Veselin Vasilev
Telerik team
 answered on 07 Dec 2010
1 answer
118 views

Hi,

I am trying to automate the controls in subject. The site below tells me UI automation for these controls are not supported for wpf applications. Is there an update/recommended solution regarding the same that I can leverage for my UI automation? It may save me a lot of time :)!

http://www.telerik.com/help/silverlight/ui_automation_support.html

 


More information on my work around and where I am stuck:

  1. DateTimePicker control

Please see attached image for reference. Using UI Spy I can actually see the window and  all of its content for the “date” control. The automation ids are missing, but at least I see the “window” control exposed and the ‘text’ names that I can actually use in my helper function to get/set a specified date.

However, the clock portion of it is hidden from UI spy. I don’t know if this is another window control or something that is just embedded in the date window? Any ideas on how I can access the clock window?

 

  1. RowDetails control

This is not exposed at all in UI Spy L! I am thinking of a work around that I have not yet tested but before I invest time in it, I was wondering if you have a recommended solution that I can use?

 


Thank you for your help and time,

Harleen

Veselin Vasilev
Telerik team
 answered on 07 Dec 2010
1 answer
76 views
I want to create rowdetails in behind code page because the contents displayed in rowdetails are vary according to the value of each column in one row. I read the example about this from telerik but it is defined when initialize not runtime. So anyone can suggest me how to do it in behind code.

Thank you,
GUIde
Rossen Hristov
Telerik team
 answered on 07 Dec 2010
12 answers
145 views
Hi,Telerik Team,
I have some problem of RadGridView .
when I am in edit mode of RadGirdView and click my apply button then radGridview row  comes in Selected Mode
and Than after i have to click second time to save the data.
i want that when i click on apply button all data which is in either edit or selected should be saved .

I am sending my two image first image is initial when i am editing something in RadGridView and when i click apply button
then second image show.and to save data i have to click apply button again.
I want that when i click apply than data should be saved.


Thanks and Regards.
Vinod Nagda
Maya
Telerik team
 answered on 07 Dec 2010
6 answers
176 views
Hi,

I have just download build 2009.2 813 which fixed an issue we were having, however it has broken something else.

If a Grid has no records in its item source and the ColumnsWidthMode is set to FIll I get the following exception:

Message="'-3' is not a valid value for property 'ViewportSize'."

The xaml code for the Grid is:

<telerik:RadGridView x:Name="radGridViewNotes"   
                     AutoGenerateColumns="False"   
                     ColumnsWidthMode="Fill"   
                     Grid.Row="2"   
                     IsReadOnly="True" 
                    
DataLoaded="RadGridViewNotes_DataLoaded" 
                     telerik:StyleManager.Theme="Office_Black">  
    <telerik:RadGridView.Columns> 
        <telerik:GridViewDataColumn Header="Subject" DataMemberPath="Subject" /> 
        <telerik:GridViewDataColumn Header="Creation Date" DataMemberPath="DateAdded" /> 
    </telerik:RadGridView.Columns> 
</telerik:RadGridView> 

If I change the ColumnsWidthMode to "None" or "Auto" it works fine.

Regards,
Glen
Vanya Pavlova
Telerik team
 answered on 07 Dec 2010
4 answers
149 views
I found two problems with zooming a line chart:

1) Clipping of data points
Let's say I have 5 points at x = 1..5. If I zoom to x = [1.5, 3.5] the line is only drawn for the points with x = 2,3,4. What i would expect is, that the line is interpolated from x = 1 to x = 2 and drawn starting with x = 1.5...

This is not only true for zooming but for drawing in general (e.g. manual axis).
If no data point is with the specified range, the line is not drawn at all. Instead i would expect the visible sector of the line is drawn.

2) Visibility
I set the visibility of some series using 
_diagram.DefaultView.ChartArea.DataSeries[myIndex].Definition.Visibility = false 
However, after zooming or scrolling, all series are visible again.

3) If at least one series has no data in a zoom range, zooming is not possible at all. (see 1)

Please fix this in an upcoming release.
Kind regards
Hartmut
Vladimir Milev
Telerik team
 answered on 07 Dec 2010
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
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?