Telerik Forums
UI for WPF Forum
3 answers
144 views
Hi... I have a basic question. Sorry, I have little experience with these Telerik Controls and overall with WPF. Basically, I have code like this:

public

 

Window1()

 

{

myAccess =

new DOAccess();

 

mySet =

new DataSet();

 

InitializeComponent();

mySet = myAccess.GetForecastData(mySet, 200802, 0, 0, 0);

mySet.Relations.Add(

"Item", mySet.Tables[0].Columns["forecast_rollup_id"],

 

mySet.Tables[1].Columns[

"forecast_rollup_id"]);

 

mySet.Relations.Add(

"Detail", mySet.Tables[1].Columns["forecast_item_id"],

 

mySet.Tables[2].Columns[

"forecast_item_id"]);

 

 

 

 

this

 

.radGridViewCustomHierarchy.DataMember = mySet.Tables[0].TableName;

 

 

this.radGridViewCustomHierarchy.ItemsSource = mySet;

 

 

}

The thing is that some columns coming from the DataSet were labeled such as "forecast_rollup_id" and I want to change the name of the actual column in the actual grid to something like "Main Item Number" (something more user-friendly). Since I am using a DataSet and I am loading information to the RadDataGrid dynamically, I am not sure how I can change the column name because when I try to get access to the columns property, I get a count value = 0 (So int columns = this.radGridViewCustomHierarchy.Columns.Count; returns zero) therefore I cannot simply do something like this: this.radGridViewCustomHierarchy.Columns["forecast_rollup_id"].HeaderText = "Main Item #"; because I get a xaml error. Furthermore, I may need to rename some columns that contain dynamic values (Thus, I cannot use alies for columns in SQL). A column may be called 200801 which needs to be renamed "Q1 2008" (Quarter One of 2008) in the grid itself. Could you please let me know how I can accomplish this change in naming to columns that were originally populated from a DataSet?

 

 

 

 

Vlad
Telerik team
 answered on 20 Aug 2009
4 answers
93 views
Hi I have just upgraded to SP1, removed the old references from my project and added the new ones but I now get the following unhandled exception when I open my main.xaml in VS2008

'-17' is not a valid value for property 'ViewportSize'.  
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)  
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)  
   at System.Windows.Controls.Primitives.ScrollBar.set_ViewportSize(Double value)  
   at Telerik.Windows.Controls.GridView.ScrollBarStateController.UpdateScrollBar(ScrollBar scrollBar, ScrollBarProperties properties) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q2_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\ScrollBarStateController.cs:line 60  
   at Telerik.Windows.Controls.GridView.GridViewScrollViewer.UpdateScrollBars() in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q2_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewScrollViewer.cs:line 503  
   at Telerik.Windows.Controls.GridView.GridViewScrollViewer.GridViewScrollViewer_LayoutUpdated(Object sender, EventArgs e) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q2_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewScrollViewer.cs:line 534  
   at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()  
   at System.Windows.ContextLayoutManager.UpdateLayout()  
   at System.Windows.UIElement.UpdateLayout()  
   at System.Windows.Interop.HwndSource.SetLayoutSize()  
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)  
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)  
   at MS.Internal.Designer.DocumentOutline.ContentHolder.Initialize()  
   at MS.Internal.Designer.DocumentOutline.Intitalize()  
   at MS.Internal.Designer.DocumentOutline.get_ContentHolderControl()  
   at MS.Internal.Designer.DocumentOutline.get_Handle()  
   at MS.Internal.Designer.VSIsolatedViewFactory.VSIsolatedView.get_ViewHandle()  
   at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle()  
   at MS.Internal.Host.Isolation.IsolatedViewHolder.SetContent(IsolatedView view)  
   at MS.Internal.Designer.DesignerPane.AttachDocumentOutline()  
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()  
 
 

Any advice?

Thanks in advance,
Kevin Preston.
Vlad
Telerik team
 answered on 20 Aug 2009
4 answers
145 views
Is there a way to use a Delegate on the TabControl?

Currently, I have (in XAML):
  SelectionChanged="radTabControl1_SelectionChanged"

in the ViewModel:
        public ICommand TabSelectionChangedCommand { get; private set; } 
 
            TabSelectionChangedCommand = new DelegateCommand<object>(param => 
            { 
                SelectionChanged(param); 
            }); 
 
        private void SelectionChanged(object obj) 
        { stuff } 

     And my otherwise empty .xaml.cs file:

        private void radTabControl1_SelectionChanged(object sender, System.Windows.RoutedEventArgs e) 
        { 
            FrameworkElement fe = (FrameworkElement)sender; 
            MyViewModel mvm = (MyViewModel) ((ObjectDataProvider)fe.DataContext).ObjectInstance; 
            if (mvm != null) 
            { 
                mvm.TabSelectionChangedCommand.Execute(sender); 
            } 
        } 
    
 
 
It works, but aren't we supposed to be able to do things without the code-behind?

Or, is there a better way to bind to the SelectedIndex ?

Adam
Top achievements
Rank 1
 answered on 19 Aug 2009
1 answer
162 views
I have a panel bar and I am using the hierarchialdatatemplate.  I am also using an MVVM pattern.  My question is how can I set the IsSelected flag on my ViewModel with a setter property and/or trigger on mouse over so that I know which item in the panel bar is currently selected during a context menu action.  I have this working on a listview, but I cannot get it to work with the panelbar.  Any help or example would be greatly appreciated.

Thanks

Damon
Tihomir Petkov
Telerik team
 answered on 19 Aug 2009
4 answers
104 views
Using VB in VS2008 with WPF 2009 Q2 Build 724.35.  The problem also showed up using Build 701.
With Build 701, when I added the second group, I got an exception in Telerik.Windows.Data with message
"Specified argument was out of the range of valid values.  Parameter name: position"
With Build 724, the exception is gone, but when grouping by two fields, either run-time or programatically, only the first data record (or the first group) is visible in the grid.  

Here is the code defining the data for the grid: 

 

Dim dsBudget As New BudgetDataSet   
Dim taDetails As New BudgetDataSetTableAdapters.DetailsTableAdapter   
taDetails.Fill(dsBudget.Details)  
RadGridView1.ItemsSource = dsBudget.Details.DefaultView  
   
 
 

 

 
Here is one simple variant of the XAML files I have used(autogenerating the columns still has the same problem):

 

 

 

<Grid>    
  <Grid:RadGridView Name="RadGridView1"   
    AutoGenerateColumns="False" >   
    <Grid:RadGridView.Columns>   
      <Grid:GridViewDataColumn HeaderText="Category"   
        DataMemberBinding="{Binding Path=Category}" >   
      </Grid:GridViewDataColumn>   
    <Grid:GridViewDataColumn HeaderText="Company"   
        DataMemberBinding="{Binding Path=Company}" >   
    </Grid:GridViewDataColumn>   
    <Grid:GridViewDataColumn HeaderText="Amount"   
        DataMemberBinding="{Binding Path=Amount}"   
        DataFormatString="{}{0:f2}" >   
    </Grid:GridViewDataColumn>   
    <Grid:GridViewDataColumn HeaderText="Description"   
        DataMemberPath="Description" >   
    </Grid:GridViewDataColumn>   
    </Grid:RadGridView.Columns>   
  </Grid:RadGridView>   
</Grid>   
 

 

 

 

 

Any insight will be greatly appreciated. 

Thanks,  Dan

 

Dan Martin
Top achievements
Rank 1
 answered on 19 Aug 2009
1 answer
193 views
Hi ,

I am not able to inherit/override style for telrik:GridViewHeaderCell

 I have Common ResourceDictionary  Style.Xaml , it has

<ResourceDictionary xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Style TargetType="telerik:GridViewHeaderCell">
        <Setter Property="FontWeight" Value="ExtraLight" />
        <Setter Property="FontStyle" Value="Normal" />
    </Style>
</ResourceDictionary>

Im MyControl.Xaml I have

  <Window.Resources>
        <Style x:Key="CheckBoxHeaderCellStyle"  TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:GridViewHeaderCell">
                        <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    
In code behind I am using

 var dict = new ResourceDictionary
                           {
                               Source = new Uri("MyApp;component/View/styles.xaml", UriKind.Relative)
                           };
Resources.MergedDictionaries.Add(dict);

I apply style in GridDataColumn as

<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource CheckBoxHeaderCellStyle}"/>

In design mode I can see the checkbox in Grid Header.But It does not show a check box in GridHeader.
Vlad
Telerik team
 answered on 19 Aug 2009
1 answer
150 views
I'm setting the grid's datacontext to a dataset with just 100 rows (and 67 columns).

Quite frankly, the gridview's *vertical* scrolling performance sucks - big time. It seems the more columns we have, the worse it gets.  "Deferred" scrolling is not an option (it lags too, BTW).  We need the grid to scroll smoothly as the scroller is dragging down the scrollbar. 

Curiously, horizontal scrolling seems to work just fine, regardless of the number of columns we have in the dataset.

What can we/you do to improve this?


Vlad
Telerik team
 answered on 19 Aug 2009
1 answer
129 views
Is there a way to move the position of a tooltip form the default?  Currently, it is displaying bellow the mouse and that is causing it to go beyond the browser window and cuts it off.  I would like it to show above and to the right of the mouse position.  Thanks.
Hector
Top achievements
Rank 1
 answered on 18 Aug 2009
5 answers
109 views

Hello

I tried putting  the 2009q2 dlls in the GAC and got the following error for the
"Telerik.Windows.Controls.Scheduler.Design.dll":

---------------------------
Assembly Cache Viewer - Install failed
---------------------------
Assembly 'Telerik.Windows.Controls.Scheduler.Design.dll' is required to be strongly named.



Thanks,

Erez
Teodor
Telerik team
 answered on 18 Aug 2009
2 answers
150 views

Hi,

I was wondering whether RadControls for WPF support UI Automation...

So I created very simple WPF application: I dragged four Rad controls on a form (RadDatePicker, RadTimePicker, RadMaskedTextBox and RadNumericUpDown). Then I assigned AutomationProperties.AutomationId for each of Rad controls (for RadDatePicker it was "datePicker", for RadTimePicker "timePicker", for RadMaskedTextBox "maskedTextBox" and for RadNumericUpDown "numUpDown").

Now in c# (in Program.cs to be precise) I written code like this (mainWindow is a AutomationElement which represents main application window):

PropertyCondition datePickerCondition =   
   new PropertyCondition(AutomationElement.AutomationIdProperty, "datePicker");  
AutomationElement datePicker =   
   mainWindow.FindFirst(TreeScope.Element | TreeScope.Descendants, datePickerCondition); //It doesn't find anything  
AutomationPattern[] datePickerPattrens =   
   datePicker.GetSupportedPatterns(); 

FindFirst method does not find anything, however It should if RadControls for WPF would support UI Automation. Out of four controls I've tested only RadNumericUpDown was found this way.

I've also checked my test application window using UISpy - only RadNumericUpDown had AutomationId properly assigned.

So my question are: 

Am I doing something wrong?

If no, when will RadControls for WPF fully support UI Automation?

RadControls for WPF version used in sample application: 2009.2.701.35

Thanks for help

Boyan
Telerik team
 answered on 18 Aug 2009
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?