Telerik Forums
UI for WPF Forum
2 answers
153 views
I am trying to fix an error I've gotten when updating to 2013.1.220.45

This is my MainWindow:
<Window x:Class="TestListView.MainWindow"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" xmlns:Controls3="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonView" xmlns:TestListView="clr-namespace:TestListView"
        Title="MainWindow" Height="350" Width="525"
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
 
        <Controls3:RadRibbonComboBox
                                 Grid.Column="0"
                                 Grid.Row="0"
                                 Margin="1"
                AlternationCount="2"
                                 Name="_comboBox"
                                 ItemsSource="{Binding TheList}"
                                 SelectedItem="{Binding TheSelection, Mode=TwoWay}"
            telerik:TextSearch.Text="Name">
            <Controls3:RadRibbonComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type Controls:RadComboBoxItem}">
                    <Style.Triggers>
                        <Trigger Property="ItemsControl.AlternationIndex"
                                     Value="1">
                            <Setter Property="Background"
                                        Value="#FFF5F7FB"></Setter>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Controls3:RadRibbonComboBox.ItemContainerStyle>
           
            <Controls3:RadRibbonComboBox.SelectionBoxTemplate>
                <DataTemplate DataType="{x:Type TestListView:Animal}" >
                    <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Name,Mode=TwoWay}" />
                        <TextBlock Text="{Binding Color,Mode=TwoWay}" />
                    </StackPanel>
                </DataTemplate>
            </Controls3:RadRibbonComboBox.SelectionBoxTemplate>
            <Controls3:RadRibbonComboBox.ItemTemplate>
                <DataTemplate >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBlock Text="{Binding Name}"/>
                        <TextBlock Text="{Binding Color}"  Grid.Row="1" Foreground="LightGray" />
                    </Grid>
                </DataTemplate>
            </Controls3:RadRibbonComboBox.ItemTemplate>
        </Controls3:RadRibbonComboBox>
 
    </Grid>
</Window>

And the MainWindow.xaml.cs looks like this:
public class Animal
  {
      public string Name { get; set; }
      public string Description { get; set; }
      public string Color { get; set; }
  }
  /// <summary>
  /// Interaction logic for MainWindow.xaml
  /// </summary>
  public partial class MainWindow : Window
  {
     
      public MainWindow()
      {
          InitializeComponent();
          TheList.Add(new Animal { Name = "Elephant", Color = "Gray", Description = "Elephants are large mammals of the family Elephantidae and the order Proboscidea. Traditionally, two species are recognised, the African elephant (Loxodonta africana) and the Asian elephant (Elephas maximus), although some evidence suggests that African bush elephants and African forest elephants are separate species (L. africana and L. cyclotis respectively). Elephants are scattered throughout sub-Saharan Africa, and South and Southeast Asia. They are the only surviving proboscideans; extinct species include mammoths and mastodons. The largest living terrestrial animals, male African elephants can reach a height of 4 m (13 ft) and weigh 7,000 kg (15,000 lb). These animals have several distinctive features, including a long proboscis or trunk used for many purposes, particularly for grasping objects. Their incisors grow into tusks, which serve as tools for moving objects and digging and as weapons for fighting. The elephant's large ear flaps help to control the temperature of its body. African elephants have larger ears and concave backs while Asian elephants have smaller ears and convex or level backs." });
          TheList.Add(new Animal { Name = "Giraffe", Color = "Yellow", Description = "The giraffe (Giraffa camelopardalis) is an African even-toed ungulate mammal, the tallest living terrestrial animal and the largest ruminant. Its species name refers to its camel-like appearance and the patches of color on its fur. Its chief distinguishing characteristics are its extremely long neck and legs, its horn-like ossicones and its distinctive coat patterns. It stands 5–6 m (16–20 ft) tall and has an average weight of 1,600 kg (3,500 lb) for males and 830 kg (1,800 lb) for females. It is classified under the family Giraffidae, along with its closest extant relative, the okapi. The nine subspecies are distinguished by their coat patterns." });
          TheList.Add(new Animal { Name = "Lion", Color = "Yellow", Description = "The lion (Panthera leo) is one of the four big cats in the genus Panthera and a member of the family Felidae. With some males exceeding 250 kg (550 lb) in weight,[4] it is the second-largest living cat after the tiger. Wild lions currently exist in sub-Saharan Africa and in Asia (where an endangered remnant population resides in Gir Forest National Park in India) while other types of lions have disappeared from North Africa and Southwest Asia in historic times. Until the late Pleistocene, about 10,000 years ago, the lion was the most widespread large land mammal after humans. They were found in most of Africa, across Eurasia from western Europe to India, and in the Americas from the Yukon to Peru.[5] The lion is a vulnerable species, having seen a major population decline of 30–50% over the past two decades[date missing] in its African range.[2] Lion populations are untenable outside designated reserves and national parks. Although the cause of the decline is not fully understood, habitat loss and conflicts with humans are currently the greatest causes of concern. Within Africa, the West African lion population is particularly endangered." });
      }
 
 
      private readonly List<Animal> _theList = new List<Animal>();
      public List<Animal> TheList
      {
          get { return _theList; }
      }
 
      private Animal _theSelection;
      public Animal TheSelection
      {
          get
          {
              if (_theSelection == null)
              {
                  _theSelection = TheList.Any() ? TheList[0] : null;
              }
              return _theSelection;
          }
          set { _theSelection = value; }
      }
  }

My problem is that it is the type of the selected item which is shown in the combobox's selectionbox - not the Name and Color as I specified in the SelectionBoxTemplate.

This is a simplified example, my real-world problem look similar but is a bit more complex. But it worked in elder version and has stopped working. I never changed the combobox implementation but I did update telerik.

BTW: If I implement ToString() on Animal-class then that value is shown in the SelectionBox. Seems like the template is never used. But I want (in my real world example) to have different colors and fontsizes on different properties of the item shown in the seletionbox.

Thanks
Inger Marie
Top achievements
Rank 1
 answered on 25 Mar 2013
5 answers
310 views
I have an autocompletebox inside the RadGridDataColumn as in the CellEditTemplate. When I run the code the It does not work or suggest any  of the items. Instead there are various binding errors in the output window.


                     <tk:GridViewDataColumn DataMemberBinding="{Binding Category}"
                                       Header="Category Name"
                                       IsGroupable="True"
                                       CellStyle="{StaticResource EditableCellStyle}"
                                       IsReadOnly="False">
                    <tk:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <tk:RadAutoCompleteBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.CategoryList}"
                                                  />
                        </DataTemplate>
                    </tk:GridViewDataColumn.CellEditTemplate>
                </tk:GridViewDataColumn>
in return the out put window looks like the attachment
 
Vladi
Telerik team
 answered on 25 Mar 2013
3 answers
174 views
Hi,

I have a grid where I have set the column to valid on property changed which works fine, The red validation appears when invalid and goes when notvalid.

However, a thin red line box persists around the now valid item. I would like to

1) Either remove this secondary validation altogether
2) Would like to align the validation process of this secondary validation so that it also works on property changed



Thanks


Dimitrina
Telerik team
 answered on 25 Mar 2013
1 answer
83 views
We're working on our first major WPF app. Isn't it possible to have test data that can be displayed in controls, especially RadListBox, RadGridView, etc., that would make it easier to style those controls? And such that, when you're running the app in Visual Studio, then the test data isn't seen. How is that done?
Yana
Telerik team
 answered on 25 Mar 2013
1 answer
182 views
Hi,


I have a DataForm that i am binding to ObservableCollection that IEditableObject implemented in it. everything is working as expected except it is not pushing the changes/additions to the database.
my collection class look like this: ("tbl_Suppliers" is the table from the database, "Supplier" is the IEditableObject, AppdataclassDataContext is the LinqToSQL datacontext):

class suppliersdatacontext
    {
        public  AppdataclassDataContext dataDC = new AppdataclassDataContext();
        private ICollectionView suppliersQur = null;
        public ICollectionView Suppliers
        {
            get
            {
                if (this.suppliersQur == null)
                {
                    ObservableCollection<Supplier> newSuppliers = new ObservableCollection<Supplier>();

                    foreach (tbl_Supplier thisSupplier in dataDC.tbl_Suppliers)
                    {
                        newSuppliers.Add(new Supplier ((int)(thisSupplier.SupplierID), thisSupplier.name, thisSupplier.country,    thisSupplier.contactperson, thisSupplier.contactemail, (decimal)(thisSupplier.discount)));
                        
                    }
 
                    this.suppliersQur = new QueryableCollectionView(newSuppliers);
                }
                return this.suppliersQur;
            }
        }
    }

Maya
Telerik team
 answered on 25 Mar 2013
0 answers
92 views
Hi,

I have developed some custom shapes(templated control) which inherit from RadDiagramShapeBase. I'd like to bind my ObservableCollection<CustomShape> to RadDiagram. How can i use GraphSource? If its not possible how can i bind my collection to raddiagram?

Best Regards
Egemen
Top achievements
Rank 1
 asked on 24 Mar 2013
3 answers
190 views
I have around 8 slots that I use to display working time. Currently there are 700 people (resources) being displayed that share those 8 slots (ie one slot may have up to 700 resources associated with it). At this point I can hardly scroll the scheduleview back and forth or up or down to view data. I do see the Copy method (on my custom slot code) fire almost constantly even when I'm not doing anything. Can someone help me solve this? When I don't add the slots performance seems good.

Rod
Yana
Telerik team
 answered on 22 Mar 2013
1 answer
284 views

Hi all,

I am using a grid view in our WPF application, the grid is bound to a data model that has two properties called “Class” and “SubClass” along with few other properties (price, year, etc…).  The grid has 2 group descriptors for those properties (Class is the parent group, and SubClass is sub-group). Each group and subgroup has a custom styled footer row that displays an aggregate total of prices.

What we are trying to achieve is that when a sub-group has only one item, it should not be indented, we want to appear in the same level as the parent group.  Also, there should be no footer total displayed for that group (since the total is just the same as the item price, no need to show the same figure twice). How can I achieve those 2 behaviors?

I tried to using the GroupFooterRowStyleSelector, and have 2 styles for the group footer, one for Visible and one for Hidden states.  And detect if row.Group.ItemCount is 1, then set the GridViewGroupFooterRow visibility to collapsed.  But that resulted on the Aggregate function are still being shown.

Any help would be appreciated!


Thanks!
Pavel Pavlov
Telerik team
 answered on 22 Mar 2013
3 answers
175 views
With Version 2013 Q1 (2013.1.220.40), I created a simple pivot grid with LocalDataSourceProvider (just following the get-start instructions http://www.telerik.com/help/wpf/radpivotgrid-getting-started.html ), however, the grid does not show up. And inside Visual Studio - Output window, the following exception log is shown:

A first chance exception of type 'System.MethodAccessException' occurred in Telerik.Pivot.Core.dll

I have tried the similar codes with version 2012 Q3 and it works. Is it a new bug?

(Note that I'm using .NET 4.0 with Binaries.NoXaml)
Rosen Vladimirov
Telerik team
 answered on 22 Mar 2013
4 answers
669 views
Hi,
 I am using Telerik Rad grid in My application. My requirement is like this.

I have Products View with their status whether Active or Inactive. So in this grid i have two Columns named "Products" and "Status".
Whenever the grid is loaded or in the first view of grid, User should able to see only all the Active Products. If user wants to see all products(both active & inactive) after loading the grid, he should able to see it by clicking on filter icon on that column.
Please tell how to do this or plz give any sample code.

Regards
Ramesh
Marco
Top achievements
Rank 1
 answered on 22 Mar 2013
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?