Telerik Forums
UI for WPF Forum
2 answers
108 views
Hi,
I'm new to Telerik and have just downloaded the latest WPF trial.
I'm having trouble with the Gridview (version 2010.3.1110.35).
I'll post the XAML below, but I'm populating from an observableCollection pulled from a WCF service.
The grid populates OK, but I cannot group the columns please can you advise.
The window is binding to an ViewModel.

I've tried another sample wher I create some objects on the fly, putting them into an observableCollection and binding to it ... and
the grouping has worked fine.

Many thanks,
Joseph.

<Window x:Class="VisionRT.CRM.WPF.TelerikMainWindow"
        mc:Ignorable="d"
        DataContext="{Binding Main, Source={StaticResource Locator}}"
        xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
        xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        d:DesignHeight="390"
        d:DesignWidth="729"
        Width="650" Loaded="Window_Loaded">
 
    <Grid>
        <telerik:RadGridView HorizontalAlignment="Stretch" Margin="12,62,12,0" Name="radGridView1"                             
                             ItemsSource="{Binding Path=ContactList, Mode=TwoWay}"
                             AutoGenerateColumns="False"
                             IsSynchronizedWithCurrentItem="True"
                             VerticalAlignment="Top" Height="248">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Title" DataMemberBinding="{Binding Title}"  Width="*" IsGroupable="True" >
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerikData:CountFunction Caption="Count: " />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding FirstName}" Width="*"   IsGroupable="True" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>
 
Vanya Pavlova
Telerik team
 answered on 06 Dec 2010
4 answers
120 views
I need  a editable rad grid view so that i can update / insert data in to my database through rad grid view only.
I need it today only Urgent.
Please help me as soon as possible
Maya
Telerik team
 answered on 06 Dec 2010
1 answer
144 views
Hi,

I have a GridViewComboBoxColumn defined in my GridView in Xaml.  I have it set up to bind properly when I set the ItemsSource property on the GridView itself.  That works great.  I would like to know how to hide the combobox that is generated in specific rows when the Grid is bound based on certain criteria of the data items for each row.  How do I do this?

Thanks.
Maya
Telerik team
 answered on 06 Dec 2010
5 answers
310 views
Hi,

        Now i m using the telerik rad map for show the details, and want to bind the shape file, but unfortunately i m using telerik q1 version, so i can't able to directly use that shape file, so i convert that as a kml file format. Now its working but i using some sample kml data's which is provided by telerik examples. but  when i look a deep look in my converted kml file, i see the values are in X,Y Values, so that i don't know How to bind this values in to the rad map, even weather rad map ll support this values or not i don't know, So plz

Explain me how to handle this, and how to convert the XY values in to decimal  latitude & Longitude.

Are any way to bind the xy values directly in the rad map control, using kml file.

Thank you
Andrey
Telerik team
 answered on 06 Dec 2010
3 answers
208 views
<telerik:RadGridView x:Name="rgvData" CanUserFreezeColumns="False" GridLinesVisibility="Horizontal" IsReadOnly="False" AutoGenerateColumns="False"
                             telerik:Theming.Theme="Office_Blue" ItemsSource="{Binding}" >
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentID}" Header="Category ID" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentFN}" Header="Category Name" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentLN}" Header="Description" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Picture}" Header="Picture" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="RadGridView1" Loaded="rgvData_Loaded" ShowInsertRow="True"  CanUserInsertRows="True"  ItemsSource="{Binding Subjects}" CanUserFreezeColumns="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsReadOnly="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SubjectID}" Header="Order ID" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SubjectName}" Header="Employee ID" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SubjectProfessor}" Header="Order Date" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCountry}" Header="Ship Country" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>

Here's my mainxaml.cs
public partial class MainWindow : Window
    {
        DataAccessDataContext m_dcData;
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            this.rgvData.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
            rgvData.Filtered += new EventHandler<Telerik.Windows.Controls.GridView.GridViewFilteredEventArgs>(rgvData_Filtered);
        }
 
        void rgvData_Loaded(object sender, RoutedEventArgs e)
        {
            var childGrid = (RadGridView)sender;
        var parentRow = childGrid.ParentRow;
 
        if (parentRow != null)
        {
            rgvData.SelectedItem = childGrid.DataContext;
            parentRow.IsExpandedChanged += new RoutedEventHandler(parentRow_IsExpandedChanged);
        }
         }
 
    void parentRow_IsExpandedChanged(object sender, RoutedEventArgs e)
    {
        rgvData.SelectedItem = ((GridViewRow)sender).DataContext;
    }x
         
 
        void rgvData_Filtered(object sender, Telerik.Windows.Controls.GridView.GridViewFilteredEventArgs e)
        {
            DataContext = m_dcData;
            m_dcData = new DataAccessDataContext();
            m_dcData.Log = Console.Out;
            rgvData.ItemsSource = m_dcData.Students;
            rgvData.ShowInsertRow = true;
        }
 
        private void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            try
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (Student item in e.NewItems)
                    {
                        m_dcData.Students.InsertOnSubmit(item);
                    }
                }
                if (e.Action == NotifyCollectionChangedAction.Remove)
                {
                    foreach (Student item in e.OldItems)
                    {
                        m_dcData.Students.DeleteOnSubmit(item);
                    }
                }
            }
            catch (Exception s)
            { }
        }
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            m_dcData = new DataAccessDataContext();
            m_dcData.Log = Console.Out;
            rgvData.ItemsSource = m_dcData.Students;
            rgvData.ShowInsertRow = true;
 
            rgvData.ItemsSource = m_dcData.Students;
            rgvData.ShowInsertRow = true;
        }
    }


Hi I have no problem on loading the child data related to its parent source. The problem is that if I try to expand another row it loads the first data for it. Example is if I have row1 expanded it displays the correct child table but if I go to row2 and expand it, its child records are for row1. I tried looking for the answer and putting the parent_IsExpandedChanged event to handle it but still it wont display the correct data. If I try to reload the application again and try to expand row 2 or row 3. its child is correct but if i expanded another row it will display the child for row 2 or row 3. Please help what am i doing wrong
Maya
Telerik team
 answered on 06 Dec 2010
1 answer
70 views
How do I upgrade my Q2 telerik wpf to Q3? I tried searching cant find any
Vlad
Telerik team
 answered on 06 Dec 2010
6 answers
134 views
I get a NullReferenceException after clicking the GridView filter button in the following scenario:

1. The GridView has too many columns to fit in the current window so it has horizontal scroll bars.
2. I scroll the GridView content to the left so that column A is not visible anymore because it is now too much to the left.
3. I scroll back to the right so that column A is visible again.
4. I click the filter button of column A.
5. NullReferenceException is thrown.

I use the official Q3 2010 release of the GridView control.

Here are the exception details:

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.GridView
  StackTrace:
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownPopupOpened(Object sender, EventArgs e) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 333
       at System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)
       at System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 129
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 75
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.set_IsDropDownOpen(Boolean value) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 64
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownButtonClick(Object sender, RoutedEventArgs e) in c:\Dev3\branches\2010.Q3.Release\Controls\GridView\GridView\GridView\Filtering\FilteringDropDown.cs:line 349
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run()
       at dcits.AdminClient.Controller.Main()
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:
David Bass
Top achievements
Rank 1
 answered on 06 Dec 2010
1 answer
97 views
Is there any flag for GridView rows that tells me if the user has changed a row or the row has been added recently? I need to traverse all the rows that are changed/inserted then update our database.
Thanks,
Milan
Telerik team
 answered on 05 Dec 2010
1 answer
58 views
Hi,
          thanks for reading my thread.
i am using rad gridview in my latest project.
here i want to create a labelbox in particular column
in rad gridview.
(here i am create 2 columns first column labelbox  second column
textbox)
 pls help me some code.


we are waiting for ur reply.(more then 8 members.)
thanks.
Rossen Hristov
Telerik team
 answered on 04 Dec 2010
2 answers
75 views
Hello
I am trying to catch the event of splitting of a raddock , but I can not handle it .
I tried PaneStateChange event ,it works for the changing position of panes but when we split the container it does not work.
Would you help me please;

Khaldoun
Top achievements
Rank 1
 answered on 03 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?