Telerik Forums
UI for WPF Forum
3 answers
109 views
I display a short list of data in WPF grid in MVVP environment.

I can edit some values in the grid itself and the SUM Agregate function is triggered and the Grid displays the new Total.

But if data is changed in the Model itself, the values are displayed in the grid rows but the SUM is not triggered !

In MVVP the Model is NOT aware of View controls and should not call a refresh method on the grid...

How can this be done ?

Thanks,

Michel

Dimitrina
Telerik team
 answered on 07 Apr 2014
1 answer
324 views
Hi,

I have this xaml code:

<telerik:RadGridView x:Name="DynTableGridView"
                   ItemsSource="{Binding DataTables">
  <telerik:RadGridView.RowDetailsTemplate>
    <DataTemplate>
       <telerik:RadBusyIndicator  IsBusy="{Binding ????? DoInput}">
              <Grid>
                ....................
                some code
                ....................
              </Grid>
           </telerik:RadBusyIndicator>
    </DataTemplate>
  </telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>
and  DynTablesViewModel class
     public class DynTablesViewModel:ViewModelBase
    {
        private ICollectionView _dataTables;
        private bool _doInput = true;
 
        public void InitData()
        {
             DataTables = new QueryableCollectionView(.........);
        }
        #region Property
 
        public bool DoInput
        {
            get { return _doInput; }
            set { _doInput = value; OnPropertyChanged("DoInput"); }
        }
        
        public ICollectionView DataTables
        {
            get { return _dataTables; }
            set { _dataTables = value; OnPropertyChanged("DataTables"); }
        }
         #endregion
    }
How to bind RadBusyIndicator in RowDetailsTemplate?  RadBusyIndicator  IsBusy="{Binding ????? DoInput}"
Vanya Pavlova
Telerik team
 answered on 07 Apr 2014
3 answers
185 views
Hello,

We have a property to display that is a List{Integer}. This should be a readonly only collection. Is the PropertyGrid smart enough to work with ReadOnlyCollections? Or what sort of DataTemplate magic do we need to do wiring it up?

Similar question for custom types like Enums, or strings, etc.

Thank ye...

Best regards.
Dimitrina
Telerik team
 answered on 07 Apr 2014
1 answer
192 views
Hello,

I'm trying to format a chart that has a status or category on the Y axis, and a time on the X axis. Please see attached image for an example of what I'm talking about. I've tried a couple different scenarios, but I'm having trouble adding CategoricalDataPoints to my LineSeries. I'm currently trying to use the RadCartesianChart, which I'm not even sure is the most appropriate. Could anyone provide some guidance on if I'm using the right chart, axes, etc...and maybe a small example of adding data to the series programatically? 

This is what I have so far, which I know is not well written, just trying to get a POC working. The CategoricalDataPoint is expecting a double as the value, but I actually just have a category.

RadCartesianChart chart = new RadCartesianChart();
            chart.HorizontalAxis = new DateTimeContinuousAxis();
            chart.VerticalAxis = new CategoricalAxis();
            LineSeries line = new LineSeries();
            line.Stroke = new SolidColorBrush(Colors.Orange);
            line.StrokeThickness = 2;
 
            SqlCeConnection con = new SqlCeConnection(connectionString); ;
            con.Open();
            using (SqlCeCommand command = new SqlCeCommand("SELECT Log.contact as contact, Status.name as status, Log.time as time FROM Log INNER JOIN Status ON Log.status_id = Status.id WHERE (Log.contact = 'Bob')", con))
            {
                SqlCeDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    DateTime time = Convert.ToDateTime(reader["time"]);
                    string person = Convert.ToString(reader["contact"]);
                    string status = Convert.ToString(reader["status"]);
 
                    if (time.DayOfYear == DateTime.Now.DayOfYear - 1)
                    {
                        line.DataPoints.Add(new CategoricalDataPoint() { Value = time, Category = status });
                    }
                }
            }
Pavel R. Pavlov
Telerik team
 answered on 07 Apr 2014
1 answer
188 views
Hi,

i created a custom shape with a special datatemplate.

RadDiagramShape StateBox = new RadDiagramShape()
{                                               
    Content = model,
     Height = 80,
     Width = 150,
     ContentTemplate = (DataTemplate)this.FindResource("SubItemTemplate"),
     Position = e.GetPosition((RadDiagram)sender),
     Geometry = droppedSwitch.Geometry,    
      IsResizingEnabled = false                           
};

DataTemplate xaml:
<DataTemplate x:Key="SubItemTemplate">
      <Grid Background="Transparent" Width="{Binding Width, Mode=TwoWay}" Height="{Binding Height, Mode=TwoWay}">    
           <TextBlock Text="{Binding SN}" x:Name="PartID" />
       </Grid>
</DataTemplate>

This works fine. But how do i add a "BeginEdit" Method to the CustomShape? Thanks so far

Best Regards
Rene
Martin Ivanov
Telerik team
 answered on 07 Apr 2014
1 answer
190 views
My application's main window is a  RadRibbonWindow that hosts a RadRibbonView. When clicking on a button another RadRibbonWindow is being opened.
When I'm testing this program on my machine everything works fine. When I'm testing on a remote machine via RDP the control Buttons (minimize/maximize/close) disappear.

I've attached a a screenshot.

App.xaml:
<Application x:Class="TelerikRibbonView.App"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
      <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
          </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
    </Application.Resources>
</Application>


MainWindow.xaml
<telerik:RadRibbonWindow x:Class="TelerikRibbonView.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">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
 
        <telerik:RadRibbonView />
        <telerik:RadButton Grid.Row="1" Width="80" Height="30" Margin="5" Click="RadButton_Click">Click me</telerik:RadButton>
    </Grid>
</telerik:RadRibbonWindow>




MainWindow.cs:
using System.Windows;
using Telerik.Windows.Controls;
 
namespace TelerikRibbonView
{
   public partial class MainWindow : RadRibbonWindow
   {
      public MainWindow()
      {
         InitializeComponent();
      }
 
      private void RadButton_Click(object sender, RoutedEventArgs e)
      {
         MainWindow secondWnd = new MainWindow();
         secondWnd.Show();
      }
   }
}


Michael


​
Martin Ivanov
Telerik team
 answered on 07 Apr 2014
1 answer
133 views
Hello,

I have successfully bound a list of items to a RadListBox ItemSource, and bound to one column as a RadPropertyGrid. The other column, we want to appear as RadChart, somehow binding to a data series. The underlying model is in the form of List Pair of TimeSpan and Double. Possibly we directly bind to this, or at least Path-ing our way into the domain model, i.e. TotalSeconds, TotalMilliseconds, etc.

Doable?

Possibly I could start with programmatically doing it, but I'd like to go the XAML route and data bind if I could. Have worked with more than one chart in this manner before.

Thank ye...

Best regards,
Petar Marchev
Telerik team
 answered on 07 Apr 2014
1 answer
174 views
Hi,

Is it possible to use SigralR as datasource with GridView?

My case is that the same database is used in my WPF application and in my web. My idea was that SignalR is used for propagating changes done in other ends. (add, delete and moved rows by drag-drop)

I was inspired by this great Kendo example:  http://demos.telerik.com/kendo-ui/web/grid/signalr.html
Nick
Telerik team
 answered on 07 Apr 2014
2 answers
166 views
Hi,
I have a RadPaneGroup where I want to add the items on a button click.
So:

<telerik:RadDocking.DocumentHost>
 <telerik:RadSplitContainer>
  <telerik:RadPaneGroup ItemsSource="{Binding RecordItems}">
   <telerik:RadPaneGroup.ContentTemplate>
    <DataTemplate>
     <views:RecordTabView DataContext="{Binding}"/>
    </DataTemplate>
   </telerik:RadPaneGroup.ContentTemplate>
   <telerik:RadPaneGroup.ItemTemplate>
    <DataTemplate>
     <TextBlock Text="{Binding Title}"/>
    </DataTemplate>
   </telerik:RadPaneGroup.ItemTemplate>
  </telerik:RadPaneGroup>
 </telerik:RadSplitContainer>
</telerik:RadDocking.DocumentHost>


On button click I add a new RecordTabViewModel to the collection.
This works perfect the content and the header are displayed correctly.
But an error occurs when I want to switch between the Tabs:

System.NullReferenceException wurde nicht behandelt.
  HResult=-2147467261
  Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
       bei Telerik.Windows.Controls.RadPane.OnHeaderMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.EventRoute.ReInvokeHandlers(Object source, RoutedEventArgs args)
       bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       bei System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
       bei System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.Run()
       bei System.Windows.Application.RunDispatcher(Object ignore)
       bei System.Windows.Application.RunInternal(Window window)
       bei System.Windows.Application.Run(Window window)
       bei System.Windows.Application.Run()
       bei EtaStudio.App.Main() in d:\Firma\Projekte\Visual Studio\Visual Studio 2013\Projects\EtaSoftware\EtaStudio\obj\x86\Debug\App.g.cs:Zeile 0.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Regards Markus

Klemens
Top achievements
Rank 1
 answered on 07 Apr 2014
3 answers
127 views
Whilst working with the telerik property grid for wpf, I realised that it automatically implemented an undo/redo command on each property in the property grid. I was wondering if there was a way I could bind this command to say a button that could be clicked for usability's sake (not individually, but for the grid as a whole).

Thanks very much in advance!
Dimitrina
Telerik team
 answered on 04 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?