Telerik Forums
UI for WPF Forum
4 answers
303 views

My code:

MainWindow.xaml

<Window x:Class="TestStyle.MainWindow"
        xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        Title="MainWindow" Height="350" Width="525">
    <StackPanel>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
        <telerik:RadButton Width="150" Content="Add new row" 
                    Command="telerikGrid:RadGridViewCommands.BeginInsert" 
                    CommandTarget="{Binding ElementName=RadGridView1}"  />
    </StackPanel>
    <telerikGrid:RadGridView 
                     SelectionMode="Single" 
                     AddingNewDataItem="RadGridView1_AddingNewDataItem"
                     x:Name="RadGridView1"  
                     AutoGenerateColumns="False">
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewComboBoxColumn Header="Screen"  
                                        UniqueName="Screen"  
                                        x:Name="screen" 
                                        DataMemberBinding="{Binding IdGrid}" 
                                        DisplayMemberPath="Name" 
                                        SelectedValueMemberPath="IdListBox" >
                <telerikGrid:GridViewComboBoxColumn.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Name}" x:Name="textblockTooltip" Width="Auto" Padding="1,1,1,1"
                            <TextBlock.ToolTip
                            <ToolTip>   
                                    <ToolTip.Template
                                    <ControlTemplate TargetType="ToolTip"
                                      <Border CornerRadius="2,2,2,2" Width="100" Height="75" x:Name="borderTooltip" Background="Green" BorderBrush="#FF000000" Margin="2"
                                       <ContentPresenter Content="{Binding GridView}" Margin="2" /> 
                                      </Border
                                    </ControlTemplate
                                    </ToolTip.Template>  
                            </ToolTip
                            </TextBlock.ToolTip>
                            </TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </telerikGrid:GridViewComboBoxColumn.ItemTemplate>
            </telerikGrid:GridViewComboBoxColumn>
        </telerikGrid:RadGridView.Columns>
    </telerikGrid:RadGridView>
    </StackPanel>
</Window>

MainWindow.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using Telerik.Windows.Controls;
  
namespace TestStyle
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
  
        bool resolution = false;
  
        public bool Resolution
        {
            get { return resolution; }
            set { resolution = value; }
        }
  
        public MainWindow()
        {
            InitializeComponent();
  
            ICommand beginInsertCommand = RadGridViewCommands.BeginInsert;
  
            ObservableCollection<ItemGrid> collectionGrid = new ObservableCollection<ItemGrid>();
            RadGridView1.ItemsSource = collectionGrid;
  
            ObservableCollection<ItemListBox> collectionListBox = new ObservableCollection<ItemListBox>();
             
            Label l1 = new Label();
            l1.Content = "Label 1";
            Label l2 = new Label();
            l2.Content = "Label 2";
            Grid gr1 = new Grid();
            gr1.Children.Add(l1);
            Grid gr2 = new Grid();
            gr2.Children.Add(l2);
  
            collectionListBox.Add(new ItemListBox(1, "Name 1", gr1));
            collectionListBox.Add(new ItemListBox(2, "Name 2", gr2));
            screen.ItemsSource = collectionListBox;
        }
  
        private void RadGridView1_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            e.NewObject = new ItemGrid(0);
        }
    }
}

ItemGrid.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.ComponentModel;
  
namespace TestStyle
{
    class ItemGrid : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
  
        private int idGrid;
  
        public int IdGrid
        {
            get { return idGrid; }
            set { idGrid = value; NotifyPropertyChanged("IdGrid"); }
        }
  
        public ItemGrid(int id)
        {
            this.idGrid = id;
        }
  
        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
}

ItemListBox.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.ComponentModel;
  
namespace TestStyle 
{
    class ItemListBox : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
  
        int idListBox;
  
        public int IdListBox
        {
            get { return idListBox; }
            set { idListBox = value; NotifyPropertyChanged("IdListBox"); }
        }
  
        string name;
  
        public string Name
        {
            get { return name; }
            set { name = value; NotifyPropertyChanged("Name"); }
        }
  
        Grid gridView;
  
        public Grid GridView
        {
            get { return gridView; }
            set { gridView = value; NotifyPropertyChanged("GridView"); }
        }
  
        public ItemListBox(int idListBox, string name, Grid gridView)
        {
            this.idListBox = idListBox;
            this.gridView = gridView;
            this.name = name;
        }
  
        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
}

I need to change Height property at Border "borderTooltip" according to value of property Resolution in ManWindow.xaml.cs.

I tried in constructor MainWindow() this:

if (Resolution == true)
    borderTooltip.Height = 75;
else 
    borderTooltip.Height = 50;

But i can´t access borderTooltip in code.Does somebody know please how to change borderTooltip.Height according to value of Resolution property?

Pavel
Top achievements
Rank 1
 answered on 14 Jan 2011
4 answers
223 views
Hi,

I want to disable the F2 in the DataGrid since i want use this key in a menuitem. I defined the F2 in a commandbinding in a menu, but it looks like the F2 key never arrive there if the DataGrid has the focus.

Any idea how i can solve this problem?

Thanks
Silvan
Top achievements
Rank 1
 answered on 14 Jan 2011
2 answers
248 views
I'm only looking for suggestions here, or any similar example should someone have one.

I have a RadGridView with a row template.  It has 14 columns.  The data template puts an image in one of the 14 columns.  The user needs to be able to click and drag this image to another column.  I'm assuming that I need to add drag events to the image in the datatemplate.  What would be needed for the grid?  

Again, this is a vague question, so I'm just looking for suggestions, or ideas on where to head with it.
Paul
Top achievements
Rank 1
 answered on 14 Jan 2011
1 answer
113 views
On 01/11/2011 9:20 AM CST, exception occured (attached) while trying to view the chart demo. Only thing I've done was, during to chart demo load, I changed the theme from default to Summer.

I'm sure you have the "example code" you ask everyone for...

Kadem
Yavor
Telerik team
 answered on 14 Jan 2011
5 answers
148 views
Hello,

I am encountering the following Exception after clicking on different column filters repeatedly.

"Object reference not set to an instance of an object."

 at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownPopupOpened(Object sender, EventArgs e)
   at Telerik.Windows.Controls.PopupWrapper.OnPopupOpened(Object sender, EventArgs e)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

There is no particular sequence to get the Exception, But clicking on different column filters randomly one after the other gives this Exception. I am using Version 2010.1.309.35

 Any ideeas why this occurs?

Thanks
Yordanka
Telerik team
 answered on 14 Jan 2011
1 answer
197 views
Can you, with tile viewer (or maybe a mixture of tile view and others) create a windows explorer type view (on the explorer menu, choose Views, then List, Tiles, or Details).  Well, I guess you can, but can it be done easily, or is it already done?  Only the container part (the list of items), not the tree view and not everything else around it.

I want to databind the control (in my case, with database items.. but more generically anything).  I thought about using Template Selectors with the tile view, list view and data grid but thought I had better ask first if there is an existing control for that. (seems like someone in the world would have created something like this already).

Thanks,
Brian
Petar Mladenov
Telerik team
 answered on 14 Jan 2011
3 answers
177 views
I need to change the mouse and selection highlight brush for all my telerik components. What is the way to achieve that?

Thanks,
Oran
Dani
Telerik team
 answered on 14 Jan 2011
4 answers
205 views
Hi,

trying to use ExportToExcelML but getting missing assembly reference in VS2010..
Checking on the documentation (http://www.telerik.com/help/wpf/telerik.windows.controls.charting-telerik.windows.controls.radchart-exporttoexcelml%28stream%29.html) the ExportToExcelML is under charting namespace and the dll is in my project reference.

what is wrong then??

thanks
Ron
ronald
Top achievements
Rank 1
 answered on 14 Jan 2011
1 answer
210 views
Following the rules and procedures stated on your documentation, I've localized a RadGridView using ResourceManager, in this way:
created the local resource files (see attached Capture01.png for resx file for italian language)
created a setting "ChosenCulture" in Settings for defining the startup default culture, set to "it-IT"
on the Window_Loaded event, set the localization with the following code:
LocalizationManager.DefaultResourceManager = ContiACasa.My.Resources.LocalResources.ResourceManager
LocalizationManager.DefaultCulture = Nothing
Thread.CurrentThread.CurrentUICulture = New CultureInfo(My.Settings.ChosenCulture)
Thread.CurrentThread.CurrentCulture = New CultureInfo(My.Settings.ChosenCulture)
The GridView is localized, but the following elements (at least the ones I've found till now) don't change their text, as you can see in the atteched picture:
GridViewGroupPanelText, GridViewGroupPanelTopTextGrouped, GridViewFilterMatchCase

TIA
Ubaldo
Maya
Telerik team
 answered on 13 Jan 2011
1 answer
198 views
Hi friends,

Problem: I do have form which has lots of controls in that i have radio button namely basic and advance. If i choose basic form should have generic controls and if i choose advance extra controls should add respective places in form. 

What i have done is i hidden controls which not a generic , so in that place i m getting blank or empty space which makes my form ugly. I just want controls to fill empty space in basic mode .

Please reply me as soon as possible , i m waiting for ur reply friend :).
Petar Mladenov
Telerik team
 answered on 13 Jan 2011
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
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?