Telerik Forums
UI for WPF Forum
4 answers
244 views

Hello support,

how can I get the selected cell within a TreeListView?

With TreeListView.SelectedItem I get the whole row (mark yellow in attached image), but how can I get the column of the selected cell (see image)?

I need this information to display a summary of the selected column.

 Thanks in advance

Marcus

Marcus
Top achievements
Rank 1
 answered on 17 Nov 2015
14 answers
351 views
Hi 

I have the following XAML defining a column with a RadNumericUpDown in the CellEditTemplate

<telerik:GridViewDataColumn DataMemberBinding="{Binding IntegerProperty}" Header="IntegerProperty">
    <telerik:GridViewDataColumn.CellEditTemplate>
        <DataTemplate>
            <telerik:RadNumericUpDown ValueFormat="Numeric" Value="{Binding IntegerProperty, Mode=TwoWay}" Minimum="1" Maximum="2" ShowButtons="False" NumberDecimalDigits="0">
            </telerik:RadNumericUpDown>
        </DataTemplate>
    </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>

Based on the above XAML, I expect the editor to restrict values to either a 1 or a 2 (these values are just an example). The behaviour I'm experiencing is that when I capture a value outside the min max bounds. The editor does not allow it, but the value displayed by the Grid is the out of bounds value. When I click back on the cell to go to the editor the value is constrained to the bounds. So I'm not sure what the real value is?

Any ideas?
Stefan Nenchev
Telerik team
 answered on 17 Nov 2015
4 answers
163 views

I have a custom QueryProvider implementation, with which I'm able to intercept Linq queries on a custom collection implementation and send this query to an API, implementing server-side filtering of data; I have RadGridViews working this way.

I was trying to achieve this with the RadAutoCompleteBox, while retaining the option to keep free text input, but it seems the ToList of ItemsSource is forcefully called *before* the filtering is done (enforcing client side filtering);

I've looked at the IFilteringBehavior interface, but it seems it gets an IList (which my collection doesn't implement, will ToList be called as well?) as a parameter; is there any way to implement this? I'm going to give IFilteringBehavior a chance, just want to be sure if there's anything better or if it doesn't work.

Fabrice
Top achievements
Rank 1
 answered on 17 Nov 2015
1 answer
122 views

Hi there!

May you help me  about some telerik component/tool to work with positional files(Files that have field determined by inicial e final positions), something like excel tool (attached picture)

A component like a track bar where user can select several positions in a file determining a initial and final position of each field

 

 

Todor
Telerik team
 answered on 17 Nov 2015
2 answers
175 views

Hello,

is there a way to place the tabs at the bottom of the document host? Here's my XAML. I'm not sure how to move them to the bottom.

 

Thanks,

Scott

 

<telerikDocking:RadDocking.DocumentHost>
                <telerikDocking:RadSplitContainer  x:Name="gridSplitterContainer">
                    <telerikDocking:RadPaneGroup>
                        <telerikDocking:RadPane  CanFloat="False" Header="Tab 1" CanUserClose="False" CanUserPin="True" x:Name="gridPane">                            
                        </telerikDocking:RadPane>
                        <telerikDocking:RadPane  CanFloat="False" Header="Tab 2" CanUserClose="False" CanUserPin="True" x:Name="gridPane2">                           
                        </telerikDocking:RadPane>
                    </telerikDocking:RadPaneGroup>
                </telerikDocking:RadSplitContainer>
            </telerikDocking:RadDocking.DocumentHost>

Kalin
Telerik team
 answered on 17 Nov 2015
1 answer
133 views

InvalidOperationException: 'PART_Clock' name cannot be found in the name scope of 'System.Windows.Controls.Grid'.

At runtime i have no errors

Kalin
Telerik team
 answered on 17 Nov 2015
1 answer
227 views

Hi @All,

as far as I could see from the samples the Telerik UI for WPF components are mainly targeted towards an WCF-based backend service.

Is it easily possible to use a ASP.NET MVC WebAPI REST-service as a backend from a WPF Desktop application?

I'd like to build a SPA web app that uses MCV Web API as a backend. There is also a mobile app that uses the same REST-services.  But for some functions the browser is not a good ​platform and I'd like to give our users a "fat-client" (e.g. for report design, Office ole-automation). But I'd also like to use the same backend for both and I wouldn't like to build a new WCF-backend only for the desktop clients. Of course the WPF application should be full-featured (data grids, data filters) and I don't want to re-invent the wheel.

Are there any samples available for this scenario?

 

Kind regards

Gerold

 

Maya
Telerik team
 answered on 17 Nov 2015
1 answer
257 views

Hello,

I'm writing a custom filter for a RadGridView and it works almost perfectly.

The only problem I have is that I am calling GetDistinctValues(ColumnToPrepare, True, Nil) on the IFilterDescriptor.Prepare method, in order to know which values I must display. During the call to GetDistinctValues, the GridView runtime calls the filter expression to filter the items.

From the documentation, it seems that this overload of GetDistinctValues should filter the items with other filters, but not the one on the current column. Is there an error in the documentation or an error in the code?

Note that I've currently curcumvent the problem by using a field to "disable" my filter in this case, but it is not a "clean" solution.

Yoan
Telerik team
 answered on 16 Nov 2015
2 answers
149 views

I have experienced an error in RadCalendar where the years displayed are wrong, after navigating outwards from the current month to the current year and then again to the current decade and out to the current century and moving back and forth. The Text property is not dislaying the CalendarButtonContent Date. Why this happens is not something I am sure, but I set the Culture of the calendar to Norwegian bokmÃ¥l (nb-no). Let me show you how at least I managed to get the RadCalendar working again. 

First off in your resource file, define a style for the RadCalendar: 

<Style TargetType="{x:Type telerikInput:RadCalendar}"><Setter Property="FontFamily" Value="Segoe UI" /><Setter Property="FontSize" Value="9" />       <EventSetter Event="Loaded" Handler="RadCalendar_Loaded" /></Style>

The style got no key, so it will be the implicit style of any RadCalendar control/instance in your app. Ok, so now let's look at the EventSetter. 


 public void RadCalendar_Loaded(object sender, EventArgs e)         {             try             {                 var radCalendar = sender as RadCalendar;                 if (radCalendar != null)                 {                     radCalendar.Culture = new CultureInfo("nb-NO");                     radCalendar.DisplayModeChanged += radCalendar_DisplayModeChanged;                     radCalendar.DisplayDateChanged += radCalendar_DisplayDateChanged;                 }             }             catch (Exception) { }         }         void radCalendar_DisplayDateChanged(object sender, Telerik.Windows.Controls.Calendar.CalendarDateChangedEventArgs e)         {             AdjustRadCalendarDisplayYearsFix(sender);         }         void radCalendar_DisplayModeChanged(object sender, Telerik.Windows.Controls.Calendar.CalendarModeChangedEventArgs e)         {             AdjustRadCalendarDisplayYearsFix(sender);         }         private static void AdjustRadCalendarDisplayYearsFix(object sender)         {             //TA 11.11.2015: Resolution of the calendar bug observed when navigating years and decades in the calendar              var calendar = sender as RadCalendar;             if (calendar == null)                 return;             DispatcherUtil.DelayedInvokeAction(() =>             {                 var calendarButtons = calendar.ChildrenOfType<CalendarButton>().ToList();                 if (calendarButtons.Any())                 {                     foreach (var c in calendarButtons.Where(cb => cb.ButtonType == CalendarButtonType.Year || cb.ButtonType == CalendarButtonType.Decade))                     {                         try                         {                              if (c.DataContext is CalendarButtonContent)                             {                                 var cbc = c.DataContext as CalendarButtonContent;                                 var tb = c.FindChildByType<TextBlock>();                                 if (tb != null)                                     tb.Text = cbc.ButtonType == CalendarButtonType.Year ? cbc.Date.ToString("yyyy") :                                          cbc.Date.ToString("yyyy") + "-" + cbc.Date.AddYears(10).ToString("yy");                             }                         }                         catch (Exception err)                         {                             Debug.WriteLine(err.Message);                         }                     }                 }             }, 500);         }

Ok, so we also use something called DelayedInvokeAction here:

      /// <summary>         /// Executes an action passed into this method by a timeout measured in milliseconds         /// </summary>         /// <param name="executeAction">Action to execute</param>         /// <param name="timeOut">The timeout to wait before executing (in milliseconds)</param>         /// <param name="priority"></param>         ///    /// <param name="keyToken">A key token to identity the switch (basic grouing). Will be used as a tag on the DispatcherTimer</param>         public static bool DelayedInvokeAction(Action executeAction, int timeOut, DispatcherPriority priority = DispatcherPriority.Background, Guid? keyToken = null)         {             var delayedAction = new DelayedAction(executeAction, timeOut, keyToken);             ActionsRegistered.Add(delayedAction);             DispatcherTimer dtimer = new DispatcherTimer(priority);             dtimer.Interval += new TimeSpan(0, 0, 0, 0, timeOut);             dtimer.Tag = delayedAction.ExecuteGuid;             dtimer.Tick += DelayedInvokeTimerTick;             dtimer.IsEnabled = true;             dtimer.Start();             return true;         }
public class DelayedAction     {         private readonly Action actionToExecute;         private readonly int timeOut;         private readonly Guid executeGuid;         public Action ActionToExecute         {             get { return actionToExecute; }         }         public int TimeOut         {             get { return timeOut; }         }         public Guid ExecuteGuid         {             get { return executeGuid; }         }         public DelayedAction(Action actionToExecute, int timeOut, Guid? keytoken)         {             this.actionToExecute = actionToExecute;             this.timeOut = timeOut;             this.executeGuid = keytoken ?? Guid.NewGuid();         }     }


Hope this helps!

Geri
Telerik team
 answered on 16 Nov 2015
4 answers
209 views

Dear Team,

I am using the docking custom property provider to save the state of my layout. When i reload the layout i can able to load the three different radpane in the specified position but data is not loading. please help to check and advise on this issue.

<Grid>
       <Grid Opacity="{Binding MainGridOpacity}">   
           <telerik:RadDocking x:Name="radDocking"
                               HasDocumentHost="False">
               <telerik:RadDocking.DocumentHost>
               <telerik:RadSplitContainer ScrollViewer.VerticalScrollBarVisibility="Auto">
                   <telerik:RadSplitContainer Orientation="Vertical" telerik:ProportionalStackPanel.RelativeSize="70, 100">
                       <telerik:RadPaneGroup>
                           <telerik:RadPane x:Name="radPane1"
                                            Header="Dashboard"
                                            telerik:RadDocking.SerializationTag="radPane1">
                               <Grid>
                                   <Grid.RowDefinitions>
                                       <RowDefinition Height="Auto" />
                                       <RowDefinition Height="Auto" />
                                       <RowDefinition Height="Auto" />
                                   </Grid.RowDefinitions>
                                   <StackPanel>
                                       <telerik:RadTabControl Width="Auto"
                                                              VerticalAlignment="Stretch"
                                                              x:Name="radDashboardTabControl">
                                       </telerik:RadTabControl>
                                   </StackPanel>
                               </Grid>
                           </telerik:RadPane>
                       </telerik:RadPaneGroup>
                   </telerik:RadSplitContainer>
                   <telerik:RadSplitContainer Orientation="Vertical"
                                              InitialPosition="DockedRight"
                                              telerik:ProportionalStackPanel.RelativeSize="30, 100">
                       <telerik:RadSplitContainer Orientation="Horizontal">
                           <telerik:RadPaneGroup telerik:ProportionalStackPanel.RelativeSize="50, 50">
                               <telerik:RadPane Header="ApplicationInfo"
                                                telerik:RadDocking.SerializationTag="ApplicationInfo">
                                   <!--<ScrollViewer VerticalScrollBarVisibility="Auto">-->
                                       <StackPanel>
                                           <TextBlock Text="{Binding AppNo}" />
                                           <ContentControl x:Name="appInfoControl" />
                                       </StackPanel>
                                   <!--</ScrollViewer>-->
                               </telerik:RadPane>
                           </telerik:RadPaneGroup>
                       </telerik:RadSplitContainer>
                       <telerik:RadSplitContainer Orientation="Horizontal">
                           <telerik:RadPaneGroup x:Name="radPaneGroup1" telerik:ProportionalStackPanel.RelativeSize="50, 50">
                               <telerik:RadPane x:Name="radPane11"
                                                Header="WorkLoad"
                                                telerik:RadDocking.SerializationTag="radPane11">
                                   <ScrollViewer Visibility="Visible"
                                                 HorizontalScrollBarVisibility="Visible">
                                       <ContentControl x:Name="workLoadControl" />
                                   </ScrollViewer>
                               </telerik:RadPane>
                           </telerik:RadPaneGroup>
                       </telerik:RadSplitContainer>
                   </telerik:RadSplitContainer>
               </telerik:RadSplitContainer>
               </telerik:RadDocking.DocumentHost>
           </telerik:RadDocking>
       </Grid>
       <Grid>   
           <StackPanel Margin="3">
               <telerik:RadButton Margin="0 2" Width="200"
                                  Content="Save Layout"
                                  Click="OnSave"
                                  x:Name="buttonSave" />
               <telerik:RadButton Margin="0 2"
                                  Width="200"
                                  Content="Load Layout"
                                  Click="OnLoad"
                                  x:Name="buttonLoad" />
           </StackPanel>
       </Grid>
   </Grid>
DashboardGridView.XMAL.cs

public partial class DashboardGridView : UserControl
    {
 System.IO.Stream stream;
        public DashboardGridView()
        {
ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(Telerik.Windows.Controls.RadDocking), new DockingCustomPropertyProvider());
}
 private void OnSave(object sender, System.Windows.RoutedEventArgs e)
        {
            PersistenceManager manager = new PersistenceManager();
            this.stream = manager.Save(this.radDocking);
            this.EnsureLoadState();
            using (FileStream file = new FileStream(@"C:\temp\file.bin", FileMode.Create, System.IO.FileAccess.Write))
            {
                byte[] bytes = new byte[stream.Length];
                stream.Read(bytes, 0, (int)stream.Length);
                file.Write(bytes, 0, bytes.Length);
                stream.Close();
            }
        }
 
        private void OnLoad(object sender, System.Windows.RoutedEventArgs e)
        {
            using (stream = new MemoryStream())
            {
                using (FileStream file = new FileStream(@"C:\temp\file.bin", FileMode.Open, FileAccess.Read))
                {
                    byte[] bytes = new byte[file.Length];
                    file.Read(bytes, 0, (int)file.Length);
                    stream.Write(bytes, 0, (int)file.Length);
                }
                this.stream.Position = 0L;
                PersistenceManager manager = new PersistenceManager();
                manager.Load(this.radDocking, this.stream);
                this.EnsureLoadState();
            }
        }
        private bool CanLoad()
        {
            return this.stream != null && this.stream.Length > 0;
        }
 
        private void EnsureLoadState()
        {
            this.buttonLoad.IsEnabled = this.CanLoad();
        }
}

Martin Ivanov
Telerik team
 answered on 16 Nov 2015
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?