Telerik Forums
UI for WPF Forum
2 answers
176 views
Hi
I am having difficulty with databinding and child objects with the RadGridview control.
I have a custom object that exposes two properties; a string and a collection (List<>) of child objects. The child objects only expose a single string property.
If I load a number of instances of the custom object each with children, into an Observable collection, the databinding seems to work and I can add new children to the existing parents without any problem.
However, if I add a new parent, when I attempt to add a new child there are databinding errors stating the property name cannot be found and the child is not retained in the child table in the grid control. (BindingExpression path error: 'FloorNo' property not found on 'object' ''Object').
I'm using the MVVM pattern so I am trying to define the hierarchy in the XAML which I've listed below.
Note: Buildings is the observable collection of the custom object Building.
BuildingNo is the string property of Building and Floors is the List<Floor> property where Floor is the child object. FloorNo is the string property of Floor.
Please can you suggest what I need to do to correct or improve the XAML to enable the creation of new children in new parents?
Thanks
Craig
<telerik:RadGridView HorizontalAlignment="Left" Margin="378,0,0,262" Name="buildingsGridView" VerticalAlignment="Bottom" Width="193" Height="197"
                     ItemsSource="{Binding Buildings, Mode=TwoWay}" AutoGenerateColumns="False" ShowGroupPanel="False" ShowInsertRow="True"
                     RowHeight="23" RowIndicatorVisibility="Collapsed" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                     CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="True" SelectedItem="{Binding SelectedBuilding}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding BuildingNo}" Header="Building No." IsFilterable="False" IsGroupable="False" IsReorderable="False" IsResizable="False" ShowDistinctFilters="False" Width="*"/>
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.ChildTableDefinitions>
        <telerik:GridViewTableDefinition>
            <telerik:GridViewTableDefinition.Relation>
                <telerik:PropertyRelation ParentPropertyName="Floors" />
            </telerik:GridViewTableDefinition.Relation>
        </telerik:GridViewTableDefinition>
    </telerik:RadGridView.ChildTableDefinitions>
    <telerik:RadGridView.HierarchyChildTemplate>
        <DataTemplate>
            <telerik:RadGridView ItemsSource="{Binding Floors, Mode=TwoWay}" Name="floorsGrid" ShowGroupPanel="False" AutoGenerateColumns="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding FloorNo}" Header="Floor No." IsFilterable="False" IsGroupable="False" IsReorderable="False" IsResizable="False" ShowDistinctFilters="False" Width="*" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </DataTemplate>
    </telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>
Yoan
Telerik team
 answered on 08 Feb 2013
1 answer
156 views

Hi There,

we observed an issue with the DateTimepicker, 

There seem to be an inconsistent behaviour in RadGridView cells. please check the attached image for more clear details, 

Thanks in advance,
Srinivas.

Dimitrina
Telerik team
 answered on 08 Feb 2013
3 answers
282 views
Hello,

I am using the ChartView with several BarSeries and want to show a popup, when a certain bar is selected.
What's the recommended way to accomplish this?

I was looking at http://www.telerik.com/help/silverlight/radchartview-features-selection.html and tried to use the SelectionChanged event. However, it never gets fired.

I also tried retemplating the BarSeries.PointTemplate and using a transparent Button that overlays the Bar.
However, the Button's command is never invoked - not even when I set the BarSeries' HitTestVisible to true.

Thank you
Petar Kirov
Telerik team
 answered on 08 Feb 2013
3 answers
259 views
RadAutocompleteBox is working fine.

but i have additional requirment that, auto search should start if user have entered 3 characters or more.

i can write script, but does it have property which can be helpful.

Ivo
Telerik team
 answered on 08 Feb 2013
5 answers
203 views
Hi,

I started work with RadCarousel recently, and I have 2 questions:

1) Is there a way to hide RadCarousel navigation panel ?  (navigation panel screenshot attached)
2) How can i make the front Item always be selected?

Thanks for your help,

Harri.
Iva
Telerik team
 answered on 08 Feb 2013
3 answers
349 views
See attached image. We have a button on our diagram nodes that lets us show more details about the node. The UI element expands thanks to some binding tricks in the template. However, as you can see, the connector follows its relative position. We would like to keep the connector at its original position in order to preserve the "arrow structure". If the arrows/connections start jumping around the user gets a little confused. Is this possible?

I sense that such a functionality requires some advanced template stuff. Please show us an example! Thanks.
Petar Mladenov
Telerik team
 answered on 08 Feb 2013
2 answers
328 views

I have a DataGrid that needs to be filtered programatically.  I populate the dependency grid with a ItemsSource with all my data in it.  When I select an item in a parent grid, I want this grid to filter showing the one or many dependency items. 

So, I'd figured out I can clear the FilterDescriptorCollection and add items to it in using this syntax.  Note FilterSettings = FilterDescriptorCollection:

aggregationGridView.FilterSettings.Clear();
foreach (AggregateDD child in aggregate.ChildList)
{
    FilterDescriptor filter = new FilterDescriptor(
         "AggregateID", FilterOperator.IsEqualTo, child.AggregateID);
    aggregationGridView.FilterSettings.Add(filter);
}

However, this seems to write a query that as AND instead of OR.  This is more the query I'd like to run:

( (AggregateID IsEqualTo 385 MC) OR (AggregateID IsEqualTo 386 MC) OR (AggregateID IsEqualTo 387 MC) OR (AggregateID IsEqualTo 388 MC) )

How do I add a new FilterDescriptor to the FilterDescriptorCollection as an OR?

Thanks for your help.

gans
Top achievements
Rank 1
 answered on 07 Feb 2013
1 answer
359 views
Is there a control that lets us set filtering on multiple controls? Preferably one where the user can set up expressions involving filter operators and fields. (Ex: all rows where column A's numerical values are more than 50 or column B's string values include 'operating'")
Rogério
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
213 views
Hi.

i have a window with some Listboxes. I want to Drag a Item from the Listbox and drop it in in a Control on a UserControl,
which is dynamically loaded.

Is there any helpfull example somewhere? PLEASE

thanks
best regards
rene
George
Telerik team
 answered on 07 Feb 2013
15 answers
864 views
Hi,

I'm using VS2008 and Telerik V2012.2.912.35 and I have a proble with the PersistenceFramework. I have a RadWindow with a root control (TabControl with 3 TabItem) and when I launch my application again, in the Loaded event of my RadWindow, I load the RadWindow persistence file previously saved and when I try to click on my second TabItem, I fall in the following exception:

System.ArgumentOutOfRangeException was unhandled by user code
  Message="DisplayIndex out of range! Département\r\nNom du paramètre : displayIndex"
  Source="Telerik.Windows.Controls.GridView"
  ParamName="displayIndex"
  StackTrace:
       à Telerik.Windows.Controls.GridViewColumnCollectionInternal.CheckDisplayIndex(GridViewColumn column, Int32 displayIndex, Boolean isAdding) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewColumnCollectionInternal.cs:ligne 773
       à Telerik.Windows.Controls.GridViewColumnCollectionInternal.CheckDisplayIndex(GridViewColumn column, Int32 displayIndex) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewColumnCollectionInternal.cs:ligne 766
       à Telerik.Windows.Controls.GridViewColumnCollectionInternal.InitializeDisplayIndexes() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewColumnCollectionInternal.cs:ligne 612
       à Telerik.Windows.Controls.GridViewColumnCollectionInternal.get_DisplayIndexes() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewColumnCollectionInternal.cs:ligne 442
       à Telerik.Windows.Controls.GridViewColumnCollectionInternal.ColumnFromDisplayIndex(Int32 displayIndex) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewColumnCollectionInternal.cs:ligne 433
       à Telerik.Windows.Controls.GridView.GridViewCellsPanel.InitializeMeasureData() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:ligne 355
       à Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:ligne 301
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       à System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Control.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Control.MeasureOverride(Size constraint)
       à Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(Size constraint) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRowItem.cs:ligne 215
       à Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(Size availableSize) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewHeaderRow.cs:ligne 234
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
       à Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(Size constraint) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ScrollViewer\GridViewScrollViewer.cs:ligne 180
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Border.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Control.MeasureOverride(Size constraint)
       à Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size constraint) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:ligne 6636
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à Telerik.Windows.Controls.RadDockPanel.MeasureOverride(Size availableSize) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Panels\RadDockPanel.cs:ligne 85
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       à System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       à System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.Controls.Control.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à Telerik.Windows.Controls.RadDockPanel.MeasureOverride(Size availableSize) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Panels\RadDockPanel.cs:ligne 85
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       à System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       à System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       à System.Windows.UIElement.Measure(Size availableSize)
       à System.Windows.ContextLayoutManager.UpdateLayout()
       à System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       à System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       à System.Windows.Threading.DispatcherOperation.InvokeImpl()
       à System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       à System.Threading.ExecutionContext.runTryCode(Object userData)
       à System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       à System.Windows.Threading.DispatcherOperation.Invoke()
       à System.Windows.Threading.Dispatcher.ProcessQueue()
       à System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       à System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       à System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       à System.Windows.Window.ShowHelper(Object booleanBox)
       à System.Windows.Window.Show()
       à System.Windows.Window.ShowDialog()
  InnerException:

Thank's
Tina Stancheva
Telerik team
 answered on 07 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
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?