Telerik Forums
UI for WPF Forum
1 answer
170 views
A RadGridView's Row is bound to a RowObject derived from DynamicObject.  Columns data are added to the grid.  Each cell is editable. Within the RowObject based on DynamicObject copies of the original data and the modified data is kept, along with information indicating whether modified data or original data is displayed for the cell. The edited value is added to the RadGridView's bound object RowObject and cause the bindings to change for edited cells. and the bindings are then controlled through RadioButtons.  A converter is used to get the data from the collection of DynamicObject's. 

The call to ElementExporting is not aware of the binding changes and exports original data when user is trying to export modified data.  Therefore, I am trying to get the bindings for the cell in ElementExporting to acquire the correct data or is the ElementExporting function capable of using the converter.  The bindings are changed when data is modified in the cell. 

On a cell by cell basis, is it possible within the ElementExporting function to get the binding of a cell to be able to display either the original data or the modified data that is currently displayed on the grid?


Yoan
Telerik team
 answered on 16 Jul 2014
6 answers
895 views
Hello,

I have a Grid that displays a start and end time for each day of the week.  The column headers must include the Date and DayOfWeek formatted basically like this: ...ToString("ddd M/d")

I'm not sure how I go about setting the Binding property.  Here's what I have just using hard coded values but really, I need these to be bound to the view model (and not StaticResource either because if the user chooses a different week, then those values must update).

        <telerik:RadGridView Grid.Row="1" Margin="10" Name="radGridViewScheduleLines" ItemsSource="{Binding ScheduleLines}" AutoGenerateColumns="False" IsFilteringAllowed="False" ShowGroupPanel="False"> 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding TeamMemberName}" Header="Team Member" CellStyle="{StaticResource TeamMemberColumnStyle}" IsSortable="False" /> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding JobCode}" Header="Code" IsSortable="False" /> 
                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding SundayStartDaySegment, Mode=TwoWay}" IsSortable="False" ItemsSource="{Binding DaySegments}" DisplayMemberPath="DisplayStart" Width="50"> 
                    <telerik:GridViewComboBoxColumn.Header> 
                        <StackPanel> 
                            <TextBlock Text="Sun 2/28 Start"  
                                       TextWrapping="Wrap"/> 
                        </StackPanel> 
                    </telerik:GridViewComboBoxColumn.Header> 
                </telerik:GridViewComboBoxColumn> 
                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding SundayEndDaySegment, Mode=TwoWay}" IsSortable="False" ItemsSource="{Binding DaySegments}" DisplayMemberPath="DisplayEnd" Width="50"> 
                    <telerik:GridViewComboBoxColumn.Header> 
                        <StackPanel> 
                            <TextBlock Text="Sun 2/28 End"  
                                       TextWrapping="Wrap"/> 
                        </StackPanel> 
                    </telerik:GridViewComboBoxColumn.Header> 
                </telerik:GridViewComboBoxColumn> 
                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding MondayStartDaySegment, Mode=TwoWay}" IsSortable="False" ItemsSource="{Binding DaySegments}" DisplayMemberPath="DisplayStart" Width="50"> 
                    <telerik:GridViewComboBoxColumn.Header> 
                        <StackPanel> 
                            <TextBlock Text="Mon 3/1 Start"  
                                       TextWrapping="Wrap"/> 
                        </StackPanel> 
                    </telerik:GridViewComboBoxColumn.Header> 
                </telerik:GridViewComboBoxColumn> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 

See the pattern?  How do I go about making the date part of the Text in the TextBlock bound to something?  I was thinking I'd just have a property hanging off the ViewModel - one for each day and each Start/End column called MondayStartHeader, MondayEndHeader, etc. That won't work though because the grid is bound to a collection of objects on the ViewModel.

Thanks.


Rohan
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
167 views
If you look at the attached image of the pivot grid you see a 2 line heading. On the 1st line of the heading I want to center the heading in the 1st line over the corresponding cells of the 2nd line (i.e. centered over 2 Columns as I have shown in the column heading "Sum Of fcOpnClr") - is this possible? and if so I do I do it. - Thanks
Kalin
Telerik team
 answered on 16 Jul 2014
1 answer
229 views
Hi,

I am using MVVM for RadDiagram control. I want to customize the connectors of the shapes, so that I can manage where the links are attached to. For shapes I use a ViewModel class which is derived from NodeViewModelBase and for links I use LinkViewModelBase<NodeViewModelBase>. How or on which layer should I manage the custom connectors? And how or where should I define them?

Thanks in advance,

Semih
Zarko
Telerik team
 answered on 16 Jul 2014
1 answer
147 views
I have a GridView bound to a DataTable. The DataTable contains columns with 'integer' names. e.g. "2000", "2014" etc.

When I try to edit a cell in the GridView, I'm shown an error: Cannot find column 2000.

I suspect this is because the column name is parsing to an int somewhere internally. When I change to column name to something like "x2000" then it works fine.

Are there any workarounds for this?
Yoan
Telerik team
 answered on 16 Jul 2014
6 answers
131 views
Hi,

I have the following scenario:
Via RadScheduleView I want to generate "Backup Schedules" (just an example).
I want to say "Every day at 10 schedule a backup".

When the backup runs I want to mark the specific schedule with backup status information.

So the idea is to add a recurring appointment to my database.
A service will check if an appointment "is ready" - if so it will call a method passing the appointment.
The method calls the backup and change the appointment according to the outcome of the process.

Since the recurring appointment is a "single record" with a recurrence rule I would:
a.) Change the "Start" of the recurring task to a time AFTER the current occurrence
b.) Create a "normal" appointment (no recurrence) for the just run job and set the status flag on this appointment

This has one "extra positive result" - if I change the schedule (let's say from 10 to 9:30) the already run appointments keep their correct "operation time", while future jobs will run at 9:30.

The negative side - I'm no longer able to find associated (past) schedules via the recurring record.

Any ideas - suggestions?

Manfred
Yana
Telerik team
 answered on 16 Jul 2014
4 answers
213 views
Hi! I'm testing your WPF controls and I'm trying to make a tree hiearchy with drag and drop. The thing is I want to disable dragging all over the place. First feature I'd need is to check for leaf to leaf collision. If I'm collinding with another leaf when dragging, i want to switch their places. The other feature i'm interested in is leaf to connection coliision. I want to do it so that if i drag a leaf and collide with a connection, if i drop it it connects to that connection, severs the connection to the old leaf and reconnects it on it's tail. What would be the best way to detect such collision in your wpf controls? Any ideas? (or maybe is there something like this already implemented? I read the docs but I might have missed something.)
Luka
Top achievements
Rank 1
 answered on 16 Jul 2014
2 answers
122 views
I've got a problem where I've got a menu that appears over part of a pie chart. When a menu item is clicked such that the mouse pointer is over a pie slice, an exception gets thrown (Exception info at the end) when the menu closes. I thought I'd just override PieSeries and catch that exception in the derived class. So, that's what I did. I created a simple derived class and overrode OnMouseLeave. That's the only thing in the derived class. Unfortunately, when using that new pie series class, none of the pie slices get drawn. Snoop tells me that the datapoints are all created and in the chart, the RadLegend is showing all the correct info. Just no slices. Do you have any suggestions?  Are there more requirements to deriving from PieSeries?

Thanks - Mitch

​Message:
Object reference not set to an instance of an object.

Operating System:
Microsoft Windows NT 6.2.9200.0

Type:
System.NullReferenceException

Data:

Key:
System.Object
Value:


HResult:
-2147467261

Message:
Object reference not set to an instance of an object.

Source:
Telerik.Windows.Controls.Chart

StackTrace:
at Telerik.Windows.Controls.ChartView.PieSeries.OnMouseLeave(MouseEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\PieChart\PieSeries.Legend.cs:line 165
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.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList`1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, DeferredElementTreeState& oldTreeState)
at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.MouseDevice.Synchronize()
at System.Windows.Input.MouseDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
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.Exc
Petar Marchev
Telerik team
 answered on 16 Jul 2014
2 answers
362 views
I have a hard time finding a sollution to delete paragraph from open document. Code below crashes on aither delSection.Blocks.Remove(delParagraph); or later on radRichTextBox.UpdateEditorLayout(); after remove vas called. The error is: "inline does not belong to this document.". This seems to happen randomly. Sometimes everything passes without an error. I cant fine a way to get this working on regular basis.

01.private void DeleteTopicFromDoc(string tag)
02.{
03.    Section delSection = null;
04.    Block delParagraph = null;
05. 
06.    foreach (Section section in radRichTextBox.Document.Sections)
07.    {
08.        foreach (var block in section.Blocks)
09.        {
10.            var paragraph = block as Paragraph;
11.            if (paragraph != null)
12.            {
13.                string topicTag = string.Format("topic_{0}", tag);
14.                if (paragraph.Tag == topicTag)
15.                {
16.                    delSection = section;
17.                    delParagraph = block;
18.                    break;
19.                }
20.            }
21.        }
22.        if (delParagraph != null) break;
23.    }
24. 
25.    if (delParagraph != null)
26.    {
27.        delSection.Blocks.Remove(delParagraph);
28.    }
29.}

Also tried a different approach found on this forum, that was suggested by admin. It was that I use selection to select paragraph to remove and the call 
radRichTextBox.Delete(false); witch deletes selected content. But the problem is that I have to remove a ReadOnlyRange. So this approach does not fit.
Evaldas
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
106 views
Hi all,

I am trying to achieve the attached. I have a list of records (filenames) which I want to show in a list. 
Anybody has any idea as to which control to use.

Regards,
Deepak
Masha
Telerik team
 answered on 16 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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?