Telerik Forums
UI for WPF Forum
3 answers
231 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
84 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
149 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
114 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
67 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
85 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
4 answers
121 views
I am binding my RadCarousel to a Generic List and cannot get my binding setup correctly. I have the following XAML for my CarouselDataRecordPresenter and this is where my binding is setup:

SceneCarousel.xaml
<Style TargetType="{x:Type telerik:CarouselDataRecordPresenter}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:CarouselDataRecordPresenter}">
                <carousel:CarouselItem DataItem="{Binding Path=CarouselItems}" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Below that, my Carousel is setup like so: 
SceneCarousel.xaml
<telerik:RadCarousel Name="Scenes" Background="Transparent" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" Loaded="LoadCarousel">
    <telerik:RadCarousel.ItemsPanel>
        <ItemsPanelTemplate>
            <telerik:RadCarouselPanel AutoLoadItems="false" ItemsPerPage="5" TopContainerChanged="RadCarouselPanel_TopContainerChanged" />
        </ItemsPanelTemplate>
    </telerik:RadCarousel.ItemsPanel>
</telerik:RadCarousel>

I am trying to bind to a List<CarouselDataItem> which is this class:
CarouselDataItem.cs
public class CarouselDataItem
{
    public SceneReference Reference { get; set; }
    public string ImagePath { get; set; }
    public Stretch ImageStretch { get; set; }
    public HorizontalAlignment TitleAlignment { get; set; }
    public Visibility ShowDeleteButton { get; set; }
    public bool AddScene { get; set; }
}

My issue is getting the DataItem to pass to my CarouselItem UserControl because I don't know how to setup the binding. Whatever I need to put in place of "{Binding Path=CarouselItems}", I can't figure out because it always comes up NULL in my CarouselItem UserControl. 
Maya
Telerik team
 answered on 03 Dec 2010
1 answer
159 views
Hi,

I just want to disable the resize animations when first open the titleview control and remain the tile exchange animation, who to do that?

I find that if set the IsItemsAnimationEnabled property to "false", all the animations are disabled :(

Regards,
LP
Zarko
Telerik team
 answered on 03 Dec 2010
1 answer
94 views
hi,
           thanks for reading my thread.
i want to create layout design using rad gridview.
 create two columns and rows.in all first column
i should create labels.second column some boxes.
its may be combo,text any thing.

is it possible?
    if possible mean then how to design?
    if not possible mean then which control i used to design?

thanks once.

Maya
Telerik team
 answered on 03 Dec 2010
2 answers
133 views
Hi

I've been having performance issues with the RadDocking system (VERYslow drawing on my work desktop, but good performance on my 5 year old cheap XP Laptop - odd). I bought a new graphics card to see what difference that makes. So I'm now running Windows7 with a GeForce 450. Performance is improved, but it's still not as good performance as my very old/slow laptop! (very puzzling).

However, a bigger problem has arisen - floating panes are now no longer visible on my second monitor (I'm using a dual screen set up). I used to be able to undock panes and drag them onto the second screen - now they are no longer rendered there. The main window renders fine.

From reading the forum it seems that the docking implementation needs to change urgently, so that it is not using this large transparent window. It seems this is causing all kinds of problems, and at the moment the RadDocking system for us is not usable.

A related issue is that when I am running a LogMeIn session on my machine, floating windows do not render. Also, the WPF Frame control does not render inside a floating pane. 

Thanks
Tom Davies
Peavey Digital Research.
Tom
Top achievements
Rank 1
 answered on 03 Dec 2010
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
SplashScreen
Rating
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?