Telerik Forums
UI for WPF Forum
1 answer
308 views
What is the correct way use a "DataColumn" object to tell the RadGridView which column to bind to? I can get it to bind using the "ColumnName" property on the column, but I would rather bind on the DataColumn object itself.

Here is a test program to demonstrate the problem

<Window x:Class="RadGridViewTest.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                xmlns:radGridViewTest="clr-namespace:RadGridViewTest"
                Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <radGridViewTest:ContextData x:Key="ContextData"/>
    </Window.Resources>
     
    <Grid DataContext="{StaticResource ContextData}">
        <telerik:RadGridView ItemsSource="{Binding Path=ExampleTable}"
                             AutoGenerateColumns="True"
                             ShowGroupPanel="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ExampleColumn}" Header="Via property"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Example}" Header="Via Column Name"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

​
using System.Data;
using System.Windows;
 
namespace RadGridViewTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
 
    public class ContextData
    {
        public ContextData()
        {
            ExampleTable = new StrongNamedDataTable();
 
            var row = ExampleTable.NewRow();
            row[ExampleTable.ExampleColumn] = "Test Data";
            ExampleTable.Rows.Add(row);
        }
 
        public StrongNamedDataTable ExampleTable { get; set; }
    }
 
    public class StrongNamedDataTable : DataTable
    {
        public StrongNamedDataTable()
        {
            ExampleColumn = this.Columns.Add("Example");
        }
 
        public DataColumn ExampleColumn { get; private set; }
    }
}


The column that I set via the property did not work, but the one referencing the column name and the auto generated column both worked. What is the correct way to reference a column using the property?
Yoan
Telerik team
 answered on 23 Jul 2014
7 answers
348 views
In SelectionMode of Single, what I want is to search on one property but show another when it is selected.

Using the First look example code, the TextSearchPath is Title. DisplayMemberPath is not set. 

I added a property to Song:

        public string SearchText
        {
            get
            {
                return string.Format("{0}, {1}", this.title, this.author);
            }
        }

I want to search on both title and author. So I changed TextSearchPath to SearchText.
What I want to show when selected is Title, so I added DisplayMemeberPath to Title. This does not work. It still shows the SearchText property when selected. 

Is this a bug, limitation, or something I can work around?

Rob
Vladi
Telerik team
 answered on 23 Jul 2014
1 answer
176 views
Hello Telerik,

I’m using the RadGridView bound to a QueryableEntityCollectionView which is just a simple SQL-Table. How can I reload the collection 
(update the UI) when only a field in an existing row has changed in the background in the SQL-Database.
Calling Refresh() works if a row is added or deleted.

Regards
Uwe
Dimitrina
Telerik team
 answered on 23 Jul 2014
1 answer
113 views
I've got a simple solution showing the leak, but cannot attach .zip file anywhere?
Maya
Telerik team
 answered on 23 Jul 2014
3 answers
525 views

We have a requirement of building an editable grid that looks something like below. Can you tell us if this is possible with minimal work using any of your controls.. including pivot control if possible. We are looking at purchasing around 8-10 developer licenses. Remember the control must support 2-way binding such that if a user changes any data in the grid, then it must correctly update the field of the correct element in the object collection:

 

Date

1/1/2012

1/2/2012

1/3/2012

1/4/2012

Customer

Cust 1

Cust 2

Cust 3

Cust 4

Bill Amount

100

200

120

50

 

As you can see it is basically a transposed list and the data format is per row/cell and not per column. Will really appreciate if someone can point me to the control that would fit this need with some directions/links etc. Also the no. of columns will be dynamic, so the grid needs to generate the appropriate no. of columns at runtime.

Dimitrina
Telerik team
 answered on 23 Jul 2014
1 answer
172 views
Hi,

I check your Datamodel at http://www.telerik.com/help/wpf/radscheduleview-populating-with-data-binding-to-db-sources.html

And I also downloaded your xamlskd example (ScheduleView_WPF - WithDB).

My problem - there is an interface IExceptionOccurence with the properties Appointment and ExceptionDate.
Appointment references the originating recurrent appointment.

But I don't understand the property ExceptionDate.
To check I did:
a.) Create a recurring appointment (every day at 9:00)
b.) Changed one occurrence to 10:00
c.) Changed that occurrence to 11:00

What I got is
b.)- added an ExceptionAppointment and an EceptionOccurrence pointing to the original Appointment
-- ExcpetionAppointment Start and ExceptionOccurrence Exception Date have 10:00 as value
c.) - changed the Start in the ExceptionAppointment to 11:00 - but did not change the ExceptionOccurrence - ExceptionDate

Further I manually changed the ExceptionOccurrence Exception Date -- that has no effect at all
But when I change the StartDate of the ExceptionAppointment the thing move in the Scheduler.

So what is this "ExceptionDate" in the IExceptionOccurence?

Manfred
George
Telerik team
 answered on 22 Jul 2014
3 answers
236 views
Hi,

I did the following.
Added a recurring (Daily) Appointment for 2014/07/21 and an exception (changed Time) for 2014/07/22.

With this data I called thisAppointment.GetOccurrences(new DateTime(2014, 7, 1), new DateTime(2014, 7, 10))

From my point of view I should get nothing since the first occurrence of the appointment is at 2014/07/21.
What I get instead is the exception from 2014/07/22.

So asking for an occurrence int the range from 2014/07/01 to 2014/07/10 I get one at 2014/07/22.

Manfred
Vladi
Telerik team
 answered on 22 Jul 2014
2 answers
428 views
I'm attempting to use the PersistenceFramework with a GridView control for the first time using the example shown here:
http://www.telerik.com/help/wpf/persistence-framework-getting-started.html

I'm importing the namespaces:
Imports Telerik.Windows.Controls
Imports Telerik.Windows.PersistenceFramework
Imports Telerik.Windows.Persistence.Storage

I have the StorageID set in my GridView:
<telerik:RadGridView Name="gvComp" telerik:StyleManager.Theme="Office_Black"  AutoGenerateColumns="False" FrozenColumnCount="3" telerik:PersistenceManager.StorageId="gvComp_Layout" EditTriggers="CellClick,TextInput,CurrentCellClick" ShowColumnFooters="True" ShowGroupFooters="True" VerticalAlignment="Stretch">

I'm saving and loading grid when the app closes and loading the grid when it opens:

Dim isoProvider As New IsolatedStorageProvider()
isoProvider.SaveToStorage()
 
Dim isoProvider As New IsolatedStorageProvider()
isoProvider.LoadFromStorage()

When LoadFromStorage() runs I get the error:  "Token not valid" 
Can someone please give me some idea what I've done wrong?  This seems really simple in the example.

Using this method will save the grid settings between application uses correct? 

Thank you for the help.

Zarko
Telerik team
 answered on 22 Jul 2014
3 answers
193 views
 {"Value cannot be null.\r\nParameter name: handler"}
 at System.Windows.UIElement.RemoveHandler(RoutedEvent routedEvent, Delegate handler)
   at Telerik.Windows.Controls.DoubleRangeBase.remove_SelectionChanged(RadRoutedEventHandler value) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Slider\DoubleRangeBase.cs:line 104


{"Exception has been thrown by the target of an invocation."}
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Unsubscribe() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 67
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 39


Click the Change button, the error occurs several times.

[MainWindowsViewModel.cs]

    private bool flag;
        void ChangeDateCommandEx(object o)
        {
            ItemsSource = GetTimelineDatas();

            EndDate = DateTime.Today;
            StartDate = flag ? EndDate.AddDays(-5) : EndDate.AddDays(-295);  // -295 => -294 (No Exception)
            flag = !flag;
        }

[Attach sample file]
http://l.bitcasa.com/VMi0hv5l
Paul
Top achievements
Rank 1
 answered on 22 Jul 2014
9 answers
212 views
Hi, 

I have a canvas with an image in background on a simple diagram, because I needed zoom in this image. This part is not problem. I need that the canvas shows in the RadDiagramNavigationPane because I only see the shapes of the diagram. 

Thanks for your help!


Pavel R. Pavlov
Telerik team
 answered on 22 Jul 2014
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?