Telerik Forums
UI for WPF Forum
3 answers
302 views
I'm trying to bind some data from an SQL Server database to a RadGridView.  I'm grabbing the data and storing it in a dataset and I've tested this to see that the data is coming in properly.  I've tried setting the ItemsSource and the DataContext with:
Grid.ItemsSource = ds.Tables[0].DefaultView;               

But the data never loads in.  This is my XAML code:

 <telerik:RadGridView Name="Grid" Grid.Row="2" Grid.ColumnSpan="3"  HorizontalAlignment="Center" VerticalAlignment="Bottom"
                             AlternateRowBackground="AliceBlue" SelectionMode="Multiple"
                             AutoGenerateColumns="False" MinHeight="300" MinWidth="800"  CanUserResizeColumns="True" CanUserResizeRows="True"
                             FilteringMode="FilterRow"  IsFilteringAllowed="True"  CanUserSortColumns="True" GridLinesVisibility="Both"
                             DataLoadMode="Asynchronous"  >
            <telerik:StyleManager.Theme>
                <telerik:Windows8Theme/>
            </telerik:StyleManager.Theme>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Width="40" Header="Add" DataMemberBinding="{Binding Add}" IsGroupable="False" IsFilterable="True" >                                
                    </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Width="75" Header="Qty"  IsGroupable="False" IsFilterable="True">
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Width="75" Header="Catalog Number" DataMemberBinding="{Binding Catalog_No}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="200" Header="Description" DataMemberBinding="{Binding Description}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="75" Header="Price" DataMemberBinding="{Binding Price}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="75" Header="Min" DataMemberBinding="{Binding Min}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="75" Header="# avl" DataMemberBinding="{Binding Available}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="75" Header="Size" DataMemberBinding="{Binding Size}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="75" Header="Color" DataMemberBinding="{Binding Color}" IsGroupable="False" IsFilterable="True"/>
                <telerik:GridViewDataColumn Width="75" Header="Style" DataMemberBinding="{Binding Style}" IsGroupable="False" IsFilterable="True"/>
            </telerik:RadGridView.Columns>
            
        </telerik:RadGridView>

So am I doing something wrong here or do I have to change the way I'm loading in the grid data?  In this case, it would not be impractical to load the data in and fill the grid view by looping through the data, but I'm going to be using the gridview in other places as well where I'll have to load in too much data for that to be a practical solution.
Vlad
Telerik team
 answered on 13 Feb 2013
11 answers
785 views

I am having a problem with the grouping functionality of the WPF Control RadGridView.   Dragging and dropping the column name to the "Drag a column header and drop it here to group by that column" area does not work.  Nothing happens, no errors.   The "IsGroupable" setting for each column is checked.  I tried explicitly setting it in the xml, and it had no effect.  The ShowGroupPanel
on the RadGridView is set.   According to the documentation that is all that is needed.

Here is the XAML file.




<code>

<UserControl x:Class="VaultSolutions.ArchiveAccelerator.ManagementConsole.JobsGridView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="1313" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation
                             xmlns:my="clr-namespace:VaultSolutions.ArchiveAccelerator.ManagementConsole" Loaded="UserControl_Loaded">
    <UserControl.Resources>
        <my:vwJobsView x:Key="ThreadCollection" />
    </UserControl.Resources>

    <DockPanel Height="Auto" Name="dockPanel1" Width="Auto" AllowDrop="True">
       
        <telerik:RadGridView Name="JobsRadGridView" AutoGenerateColumns="False" Width="Auto" ItemsSource="{Binding Source=   {StaticResource ResourceKey=ThreadCollection}}" EnableRowVirtualization="True" EnableColumnVirtualization="True" AllowDrop="True" Drop="JobsRadGridView_Drop">

            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Name="ThreadIdentity" DataMemberBinding="{Binding Path=ThreadIdentity}" Header="Job #" TextAlignment="Right" />
                <telerik:GridViewDataColumn Name="TaskName"       DataMemberBinding="{Binding Path=TaskName}" Header="Task Name"/>
                <telerik:GridViewDataColumn Name="DTStarted"      DataMemberBinding="{Binding Path=DTStarted}" Header="DT Started"/>
                <telerik:GridViewDataColumn Name="DTStopped"      DataMemberBinding="{Binding Path=DTStopped}" Header="DT Stopped"/>
                <telerik:GridViewDataColumn Name="Target"         DataMemberBinding="{Binding Path=Target}" Header="Target" />
                <telerik:GridViewDataColumn Name="SubTarget"      DataMemberBinding="{Binding Path=SubTarget}" Header="Sub Target" Width="200" />
                <telerik:GridViewDataColumn Name="NumProcessed"   DataMemberBinding="{Binding Path=NumProcessed}" Header="# Processed" TextAlignment="Right" />
                <telerik:GridViewDataColumn Name="NumError"       DataMemberBinding="{Binding Path=NumError}" Header="# Error" TextAlignment="Right" />
                <telerik:GridViewDataColumn Name="EventMessage"   DataMemberBinding="{Binding Path=EventMessage}" Header="Event Message" TextWrapping="Wrap" />
                <telerik:GridViewDataColumn Name="JobStatus"      DataMemberBinding="{Binding Path=JobStatus}" Header="Job Status"/>
                <telerik:GridViewDataColumn Name="LastUpdate"     DataMemberBinding="{Binding Path=LastUpdate}" Header="Last Update"/>
                <telerik:GridViewDataColumn Name="Servername"     DataMemberBinding="{Binding Path=Servername}" Header="Server Name"/>
            </telerik:RadGridView.Columns>

        </telerik:RadGridView>
      
    </DockPanel>
                 
</UserControl>
</code>


The "ThreadCollection" is an ObservableCollection.

Adding the following, displays the groups.  They are grouped correctly.  All seems to work unless you drag the group name off of the group bar, or use the close icon on the group name.  The GridView will be correct, but you can not get the group back again.

           
<telerik:RadGridView.GroupDescriptors>
   <telerik:GroupDescriptor Member="Target" />
   <telerik:GroupDescriptor Member="JobStatus" />
   <telerik:GroupDescriptor Member="Servername" />
</telerik:RadGridView.GroupDescriptors>

In an attempt to debug, I added event hanlders for Grouped and Grouping events.  They never got called on the drag and drop to the group bar.  The only time they were called is when the GroupDescripitors were in place, and then only when the groups were removed from the bar. 

Using Telerik version 12.1.326.0
VisualStudio 2010
.NET 3.5
C#
Windows Server 2003 R2

Any suggestions would be appreciated.

Vlad
Telerik team
 answered on 13 Feb 2013
6 answers
195 views
I have followed the project at http://www.telerik.com/help/silverlight/raddatafilter-how-to-create-custom-filter-editors.html to create a solution that uses a RadComboBox as a custom filter for some fields in a RadDataFilter.

I have been unable however to get the value selected in the RadComboBox to update the underlying FilterDescription, with the Filter always ending up with 'Status isEqualTo <unset>' after selecting an item in the combo box.

I am sure I have followed the project correctly, and have the SelectedValue of the ComboBox bound to the Value property as below.

<DataTemplate x:Key="ComboBoxEditor">
       <telerik:RadComboBox SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}" MinWidth="100" />
</DataTemplate>


The only difference I can see to the example code is that I am using the RadDataFilter unbound. It is not bound to a DataGrid, I am setting my own ItemPropertyDefinitions and using the resulting FilterDescriptions in other parts of the project. Is there a way to check that the DataTemplate Value is getting set when the RadComboBox value changes, or do I need to force the FilterDescription to update somehow as it is unbound? Finally, if nothing else is there a way to manually set the Value or update the FilterDescription when the ComboBox value changes?

Thanks

Yezdi
Top achievements
Rank 1
 answered on 12 Feb 2013
5 answers
146 views
I am verifying that my view's property setter is indeed setting. However, the PropertyGrid editor is not losing focus. That is, I don't see the (somewhat) expected editor exit and change indicator, that sort of thing. I don't know if it's a Xaml issue or not. Not setting the values special otherwise: I have an INotifyPropertyChanged-based view into my domain model. Nothing spectacular there.

<telerik:RadPropertyGrid Name="_rpgTranslation"
                         Grid.Row="1"
                         AutoGenerateBindingPaths="True"
                         telerik:StyleManager.Theme="Expression_Dark"/>
Maya
Telerik team
 answered on 12 Feb 2013
1 answer
68 views
Worst case I'll go with something like a built-in string text editor. However, would be nice to fold in the validation for instance if Version.TryParse fails. How to go about doing this for the RadPropertyGrid for WPF please? Thanks!
Maya
Telerik team
 answered on 12 Feb 2013
4 answers
324 views
Hi,

I've looked into this a good bit and can find nothing relevant.  Any threads touching on the subject are old and the API has since changed.  Basically I need to get access to an individual cell so that I can set a style for it.  I would expect there to be easy access to cells in the same way that columns can be accessed.

I'm looking for something like: 

myGrid.Columns[0].Rows[0].Style = myStyle;

A call like that would give me access to the top left cell of the grid.

Is there any way to do something like this?

Thanks,
Austin
Dimitrina
Telerik team
 answered on 12 Feb 2013
6 answers
294 views
Hi,
(Wrongly posted on gant forum)

I want to create this behavior:

I want to be able to select only full lines, and act on double click on the line -

currently I have 2 problems with this code:

<telerik:RadGridView Name="gdTestRecords" DockPanel.Dock="Bottom" AutoGenerateColumns="False" ClipboardCopyMode ="All" MouseDoubleClick="gdTestRecords_MouseDoubleClick" SelectionMode="Extended" SelectionUnit="FullRow" MaxHeight="600" ScrollViewer.VerticalScrollBarVisibility="Visible">


1, when I double click inside the line - it selects the cell and not the line - I can only choose the line by clicking on the edge of the line.
    this code will return null: RecordType st = ((FrameworkElement)e.OriginalSource).DataContext as RecordType (unless I click on the edge)
2. when I click on the vertical scroll bar more than 2 times - it acts like selecting a cell ! - I need to interpreting clicking on scroll bar as clicking on the grid surface and not clicking inside the line.

How can I fix this ?

dani
Top achievements
Rank 1
 answered on 12 Feb 2013
0 answers
61 views
The question is closed.
Yu
Top achievements
Rank 1
 asked on 12 Feb 2013
2 answers
228 views
I have a UserControl that contains a RadPropertyGrid and one of the property definitions for the RadPropertyGrid has the EditorTemplate set to a DataTemplate that contains a RadComboBox.  When I run the application, I get the following exception:

Could not load file or assembly 'Telerik.Windows.Controls.Input, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified.

If I add a RadComboBox to the UserControl, the RadComboBox displays just fine.

What am I missing?


Here is the XAML:

<UserControl x:Class="Company.KendoJavaScriptExtension.MyControl"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:Company.KendoJavaScriptExtension"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300"
             Name="MyToolWindow" Loaded="MyToolWindow_Loaded">
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <DataTemplate x:Key="comboboxTemplate">
                <telerik:RadComboBox />
            </DataTemplate>
        </Grid.Resources>
         
        <telerik:RadPropertyGrid x:Name="propertyGrid" Loaded="propertyGrid_Loaded" />
    </Grid>
</UserControl>

In the UserControl's Loaded event handler, I have code similar to the following:

this.propertyGrid.PropertyDefinitions[5].EditorTemplate = LayoutRoot.Resources["comboboxTemplate"] as DataTemplate;
Craig
Top achievements
Rank 1
 answered on 12 Feb 2013
1 answer
158 views
I would like to be able to add a small shape (upward-pointing triangle) to the X axis of a bar chart under one of the bars.  The build report for Microsoft Team Foundation client shows something similar to what I have in mind (see attached PNG).

As a strategy, should I try to use a CartesianCustomAnnotation, and if so can that be used with a marker in a BarSeries?  How do I indicate that I want the triangle to sit under the bar marker?  Or should this be an annotation attached to the axis somehow, and if so how would I add an annotation to the X axis?

thanks,
Derek
 

Evgenia
Telerik team
 answered on 12 Feb 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
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?