Telerik Forums
UI for WPF Forum
1 answer
116 views
Is it possible to make the GridView 100% 508 compliant? Does anyone have a specific solution?

The GridView I have is one that:

1) Data sources change. Same GridView is used to display many different collections of data depending on menu selection.

2) Selectable rows and cells. Double-click and a dialog shows to change values in the selected row.

3) Has sortable columns and the headers need to be readable by screen readers.

That's about all there is to it. I use JAWS to test the accessibility. I'm into UIAutomation. Any help is greatly appreciated. I don't want to have to replace the GridView with the standard WPF Data Grid.

Thank you.
Vlad
Telerik team
 answered on 16 Jan 2012
3 answers
110 views
Hi

I'm interested how can I find (and access in code) customized fields in a RadDataForm (edit) template.
When I edit a record Focus is not set on first field.
Can anyone give me a hint?

Thanks!
Ivan Ivanov
Telerik team
 answered on 16 Jan 2012
8 answers
533 views
Hi,

Continuing the same example as was in the previous query.

<telerik:RadTreeView HorizontalAlignment="Left"
                             x:Name="uxOrgTree"
                             Width="Auto"
                             Height="Auto"
                             d:LayoutOverrides="Height"  
                             VerticalAlignment="Top"
                             Margin="0,0,0,0"
                             SelectionMode="Single"
                             IsEditable="True"
                             ItemsSource="{Binding RootNodes}" >
            <telerik:RadTreeView.Resources>
                <HierarchicalDataTemplate DataType="{x:Type Entities:Node}" ItemsSource="{Binding Children}" >
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path= Name}"/>
                    </StackPanel>
                </HierarchicalDataTemplate>
            </telerik:RadTreeView.Resources>
      <telerik:RadTreeView.ItemContainerStyle>
                <Style TargetType="{x:Type telerik:RadTreeViewItem}">
                    <EventSetter Event="Edited" Handler="RadTreeViewItem_Edited" />
                 </Style>
            </telerik:RadTreeView.ItemContainerStyle>
        </telerik:RadTreeView>

I am trying to do something like styled as bold, in the code behind:

 private void ContextMenu_ContextMenuOpening(object sender, ContextMenuEventArgs e)
        {
               RadTreeViewItem currentItem = sender as RadTreeViewItem;
                if (currentItem != null)
                {
                    currentItem.ContextMenu.Tag = currentItem;
                }
      }

  private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            MenuItem menu = sender as MenuItem;
            if (menu != null)
            {
                  ContextMenu contextMenu = this.FindResource("uxContextMenu") as ContextMenu;

                    Debug.Assert(contextMenu != null, "contextMenu == null", "null contextMenu");
                    RadTreeViewItem currentItem = contextMenu.Tag as RadTreeViewItem;
                   
                   //looking for 5th child of the currentItem, not sure how to get children if a treeview item.
                    currentItem.Children[5] as RadTreeViewItem;

                       
             }
        }

Thanks
Sonal
Hussein
Top achievements
Rank 1
 answered on 16 Jan 2012
1 answer
270 views

Is there any easy way to use style from filtering list (e.g in grid view filter - first picture) as default style for all scroll viewers (second picture) 

Thanks for help.

Jakub
Top achievements
Rank 1
 answered on 16 Jan 2012
1 answer
173 views
I am using the GridView to display up to 1,000 rows of data.  I am required to provide an elapsed time column.  I have found a similar thread here:http://www.telerik.com/community/forums/silverlight/gridview/updating-column-periodically-with-current-timespan-now-created.aspx .
I had the same thought of utilizing a Dispatch Timer in my ViewModel and updating each item in the data bound ItemSource collection.  However; I must display this elapsed time by second versus minute.  Updating each Model each second cannot be the best way to handle this.  I do not see an event I can respond to which would provide me a collection of those rows being displayed.  I assume that internally the GridView has such a collection for performance reasons.  Is this collection exposed or is there some other mechanism I should use?

Thanks

Pavel Pavlov
Telerik team
 answered on 16 Jan 2012
5 answers
372 views
Hi there, we're currently evaluating some controls in the RadControls library.

We can't get the "Drag and Drop Between ListBoxes - Basic" example http://www.telerik.com/help/wpf/raddraganddrop-between-listboxes.html working.  We've precisely followed the example, yet there is no effect when attempting to drag items from one listbox to the other.

Here's the C#

using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Telerik.Windows.Controls.DragDrop;
 
namespace RadDragDrop2
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public ObservableCollection<CheckableItemsViewModel> List1 { get; set; }
        public ObservableCollection<CheckableItemsViewModel> List2 { get; set; }
 
        public MainWindow()
        {
            InitializeComponent();
 
            List1 = new ObservableCollection<CheckableItemsViewModel>();
            List2 = new ObservableCollection<CheckableItemsViewModel>();
 
            LayoutRoot.DataContext = this;
 
            listBox1.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDropQuery));
            listBox1.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDragQuery));
            listBox1.AddHandler(RadDragAndDropManager.DropInfoEvent, new EventHandler<DragDropEventArgs>(OnDropInfo));
            listBox1.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnDragInfo));
            listBox2.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDropQuery));
            listBox2.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnDragQuery));
            listBox2.AddHandler(RadDragAndDropManager.DropInfoEvent, new EventHandler<DragDropEventArgs>(OnDropInfo));
            listBox2.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler<DragDropEventArgs>(OnDragInfo));
 
            List1.Add(new CheckableItemsViewModel() { Name = "one", IsChecked = true });
            List1.Add(new CheckableItemsViewModel() { Name = "two", IsChecked = false });
            List1.Add(new CheckableItemsViewModel() { Name = "three", IsChecked = true });
 
            List2.Add(new CheckableItemsViewModel() { Name = "four", IsChecked = false });
            List2.Add(new CheckableItemsViewModel() { Name = "five", IsChecked = true });
            List2.Add(new CheckableItemsViewModel() { Name = "six", IsChecked = false });
        }
 
        private void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            if (e.Options.Status == DragStatus.DragQuery)
            {
                var draggedItem = e.Options.Source;
                e.QueryResult = true;
                e.Handled = true;
                // Create Drag and Arrow Cue
                ContentControl dragCue = new ContentControl();
                dragCue.Content = draggedItem.DataContext;
                dragCue.ContentTemplate = this.Resources["DragCueTemplate"] as DataTemplate;
                e.Options.DragCue = dragCue;
                e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();
                // Set the payload (this is the item that is currently dragged)
                e.Options.Payload = draggedItem.DataContext;
            }
            if (e.Options.Status == DragStatus.DropSourceQuery)
            {
                e.QueryResult = true;
                e.Handled = true;
            }
        }
 
        private void OnDragInfo(object sender, DragDropEventArgs e)
        {
            // if we are dropping on the appropriate listbox, then remove the item from the first listbox.
            if (e.Options.Status == DragStatus.DragComplete)
            {
                var itemsControl = e.Options.Source.FindItemsConrolParent() as ItemsControl;
                var itemsSource = itemsControl.ItemsSource as IList;
                itemsSource.Remove(e.Options.Payload);
            }
        }
 
        private void OnDropQuery(object sender, DragDropQueryEventArgs e)
        {
            var destination = e.Options.Destination as ListBox;
            if (e.Options.Status == DragStatus.DropDestinationQuery &&
                destination != null)
            {
                e.QueryResult = true;
                e.Handled = true;
            }
        }
 
        private void OnDropInfo(object sender, DragDropEventArgs e)
        {
            // if we are dropping on the appropriate listbox, then add the dragged item to it.
            var destination = e.Options.Destination as ItemsControl;
            if (e.Options.Status == DragStatus.DropComplete &&
                 destination != null)
            {
                (destination.ItemsSource as IList).Add(e.Options.Payload);
            }
        }
    }
 
    public class CheckableItemsViewModel
    {
        public bool IsChecked { get; set; }
        public string Name { get; set; }
    }
 
    public static class ControlExtensions
    {
        public static ItemsControl FindItemsConrolParent(this FrameworkElement target)
        {
            ItemsControl result = null;
            result = target.Parent as ItemsControl;
            if (result != null)
            {
                return result;
            }
            result = ItemsControl.ItemsControlFromItemContainer(target);
            if (result != null)
            {
                return result;
            }
            return FindVisualParent<ItemsControl>(target);
        }
        public static T FindVisualParent<T>(FrameworkElement target) where T : FrameworkElement
        {
            if (target == null)
            {
                return null;
            }
            var visParent = VisualTreeHelper.GetParent(target);
            var result = visParent as T;
            if (result != null)
            {
                return result;
            }
            return FindVisualParent<T>(visParent as FrameworkElement);
        }
    }
}

Here's the XAML:

<Window x:Class="RadDragDrop2.MainWindow"
        xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
        Title="MainWindow" Width="320" Height="240">
     
    <Window.Resources>
        <DataTemplate x:Key="ItemTemplate">
            <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Content="{Binding Name}" />
        </DataTemplate>
 
        <Style TargetType="Control" x:Key="DraggableItem">
            <Setter Property="telerikDragDrop:RadDragAndDropManager.AllowDrag" Value="True" />
            <Setter Property="telerikDragDrop:RadDragAndDropManager.AllowDrop" Value="True" />
        </Style>
        <Style TargetType="ListBox" x:Key="DraggableListBox">
            <Setter Property="telerikDragDrop:RadDragAndDropManager.AllowDrop" Value="True" />
            <Setter Property="ItemContainerStyle" Value="{StaticResource DraggableItem}" />
        </Style>
 
        <DataTemplate x:Key="DragCueTemplate">
            <TextBlock Text="{Binding Name}"/>
        </DataTemplate>
    </Window.Resources>
 
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
 
        <ListBox x:Name="listBox1" Grid.Column="0" ItemsSource="{Binding Path=List1}" ItemTemplate="{StaticResource ItemTemplate}" Style="{StaticResource DraggableListBox}"/>
        <ListBox x:Name="listBox2" Grid.Column="1" ItemsSource="{Binding Path=List2}" ItemTemplate="{StaticResource ItemTemplate}" Style="{StaticResource DraggableListBox}"/>
    </Grid>
</Window>
Martin
Top achievements
Rank 1
 answered on 16 Jan 2012
1 answer
195 views
Hi,
I an trying to create a PieChart like:

<chart:RadChart
                                Name="qwe"
                                Content="RadChart"
                                ItemsSource="{Binding PieChartItems}">
                                <chart:RadChart.DefaultView>
                                    <charting:ChartDefaultView>
                                        <charting:ChartDefaultView.ChartArea/>
                                        <charting:ChartDefaultView.ChartTitle>
                                            <charting:ChartTitle Content="CHART TITLE"/>
                                        </charting:ChartDefaultView.ChartTitle>
                                        <charting:ChartDefaultView.ChartLegend>
                                            <charting:ChartLegend
                                                x:Name="ChartLegend2"
                                                Visibility="Visible"
                                                Header="ABC"
                                                Padding="0,0,5,0"
                                                HorizontalContentAlignment="Right"
                                                BorderThickness="0"
                                                Background="Transparent"/>
                                        </charting:ChartDefaultView.ChartLegend>
                                    </charting:ChartDefaultView>
                                </chart:RadChart.DefaultView>

The problem is where in the code I should add a manual series mapping in order to bind labels to a collection in VM.
Nikolay
Telerik team
 answered on 16 Jan 2012
5 answers
230 views
Hello,

Haven't found a specific case like mine on the forums, but I've tried several variances of code I've seen with no avail.

My problem is simple in nature, I have a data-bound GridViewComboBoxColumn that, when I load the program, doesn't display values synonymous with the data its bound to, or at all.  Data its bound to is correct on our other application using the same datasource, and the List<T> its bound to shows up when the combo box is clicked on, there are just no values initially in the grid.

XAML
<telerik:GridViewComboBoxColumn Header="Type" Width="160" UniqueName="Type" DataMemberBinding="{Binding Path=Type}" DisplayMemberPath="Name" /> 

C# on constructor call for the new view being created.
((GridViewComboBoxColumn)(Tasks.Columns[1])).ItemsSource = AdminHandler.GetQuestTaskTypes();

This is the ONLY instance of this in our tool, while every other GridViewComboBoxColumn is formatted the same way and working perfectly.  The only difference with this, is the C# is getting called inside the constructor of a new view, while the rest of the ItemsSource assignments are inside the LayoutRoot_Loaded event.

Thank you.
Maya
Telerik team
 answered on 16 Jan 2012
0 answers
142 views
I am working with Telerik WPF controls, RadGridView, RadDataPager and VirtualQueryableCollectionView<T>.
The PageCount of RadDataPager is incorrect once i filtered the data via RadGridView header. The PageCount  is  
always 1.  please find attached image screenshot.

I do not know how to fix this issue. In following code, i set the VirtualItemCount value as new value but the RadDataPager show me 1 as PageCount. I could not move to next page.  

Assembly version is: 2011.3.1220.40 

<telerik:RadGridView x:Name="GridView" ItemsSource="{Binding DataView}" Width="700" MinHeight="386" MaxHeight="500"
                .........
</telerik:RadGridView>
  
<telerik:RadDataPager PageSize="100" Grid.Row="1" Source="{Binding DataView}"  />

public VirtualQueryableCollectionView<VSOEChageItemViewModel> DataView
     {
         get
         {
             if (_DataView == null)
             {
                 _DataView = new VirtualQueryableCollectionView<VSOEChageItemViewModel>() { LoadSize = 40, VirtualItemCount = 40 };
                 _DataView.ItemsLoading += DataViewItemsLoading;
             }
             return _DataView;
         }
         private set
         {
             if (_DataView != null)
             {
                 _DataView.ItemsLoading -= DataViewItemsLoading;
             }
  
             _DataView = value;
  
             if (_DataView != null)
             {
                 _DataView.ItemsLoading += DataViewItemsLoading;
             }
         }
     }

private void DataViewItemsLoading(object sender, VirtualQueryableCollectionViewItemsLoadingEventArgs e)
     {
         string filertString = GetFilertString();
  
         var sort = DataView.SortDescriptors;
         var sortString = sort.ToDynamicLinq();
         if (!string.IsNullOrEmpty(sortString))
             sortString = sortString.Remove(0, sortString.IndexOf(".") + 1);
  
         int allCount = 0;
         List<VSOEChageItemViewModel> dd1 = LoadData(filertString, sortString, e.StartIndex, e.ItemCount, out allCount);
  
  
         if (allCount != DataView.VirtualItemCount)
         {
             DataView.VirtualItemCount = allCount;
         }
  
         DataView.Load(e.StartIndex, dd1);
  
     }
Srikrishna Illendula
Top achievements
Rank 1
 asked on 16 Jan 2012
4 answers
109 views
When I plot an OHLCSeries or CandlestickSeries on a ChartView, sometimes I have data points where the open, high, low, and close values are all the same.  In these cases, the data point doesn't show up at all -- no matter how far I may zoom in.  It seems that I should at least be able to see some small visual indicator of where the data point is instead of it being completely invisible.  This seems like a bug/usability issue, but I could be wrong.  Is this behavior by design?  

I'd like to request that such data points always be shown or that an option be provided to show them when each OHLC component value is the same.  Thanks!

Paul     
Paul
Top achievements
Rank 1
 answered on 14 Jan 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?