Telerik Forums
UI for WPF Forum
1 answer
82 views
I'd like to change the itemtemplate of the radcombobox depending on wheter it's opened or closed.

Is it possible? any help on how to accomplish it?

Thanks in advance.
Sergi
Top achievements
Rank 1
 answered on 21 Mar 2011
3 answers
114 views
Hi,

I have noticed, even in your example "Customize auto-generated fields" that certain fields after created are editable even when not in edit mode, an example of this is "StartingDate" in your example. I have created a RadComboBox in my application and I have noticed that indeed it is editable even when not in edit mode. Do I need to handle enabling and disabling of these controls myself?

Thanks,
Daryl
Vlad
Telerik team
 answered on 21 Mar 2011
3 answers
192 views
Hello everyone,

we have the following use case: a RadGridView with a Details section where both, the row and the details section has editable contents. If someone changes a property (either in a cell or in a control inside the details section) we need to defer sorting actions of the rad grid view in order to prevent the current item to be sorted "out of scope". This happens if you have a lot of items, sort by property 1 ascending, then change the value of "A" to "Z" (which re-sorts the current item to the end of the list).

We tried hooking up to sorting event and set the cancel flag to "false" but it is not called if you the cell is commited on focus lost. We tried also to set ActionOnLostFocus to none, but after clicking on a empty region inside the details element (i.e. not a button) the current cell is committed and the gridview re-sorts itself.

Any advise how to prevent the grid to automatically sort our current selected item out of view?

Example:

<telerik:RadGridView Sorting="Grid_Sorting"  x:Name="Grid" ActionOnLostFocus="None" AutoGenerateColumns="False" RowDetailsVisibilityMode="VisibleWhenSelected">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="False" DataMemberBinding="{Binding FormOfAddress}">
                 <telerik:GridViewDataColumn.CellEditTemplate>
                     <DataTemplate>
                         <ComboBox SelectedItem="{Binding FormOfAddress}" ItemsSource="{Binding AvailableFormOfAddresses}" />
                     </DataTemplate>
                 </telerik:GridViewDataColumn.CellEditTemplate>
             </telerik:GridViewDataColumn>
         </telerik:RadGridView.Columns>
         <telerik:RadGridView.RowDetailsTemplate>
             <DataTemplate>
                 <Border Background="Red" Width="100" Height="100">
                     <StackPanel>
                         <!-- Clicking on this text commits the ComboBox and re-sorts the grid -->
                         <TextBlock Text="{Binding FormOfAddress}" />
                           
                         <!-- Clicking on this button does not commit the ComboBox -->
                         <Button Content="Save" />
                     </StackPanel>
                 </Border>
             </DataTemplate>
         </telerik:RadGridView.RowDetailsTemplate>
     </telerik:RadGridView>

Code behind:
private void Grid_Sorting(object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e) {
    Debug.WriteLine("Sorting called.");
}

The output "Sorting called" is only shown if a user sorts the column, but if the grid itself re-sorts it this text is not printed and therefore can't be canceled.

Version: RadControls for WPF Q1 2011

Thanks in advance,

Christian

Vlad
Telerik team
 answered on 21 Mar 2011
1 answer
252 views
Hello,

I have a small problem.
As the data source of the chart I am using a DataTable because the DataSeries can be added dynamically.
Therefore it was the easiest way for me.

The DataTable has the following structure
   - Timestamp : DateTime
   - Value1 : double
   - Value2 : double

The problem is that in my case it is possible that a few rows have Value1 or Value2 = null because there was no value at this timestamp.
The chart displays this null value as 0. But for me it would be nice if it just ignores the null value

I created a small example which shows the problem:
public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();
 
      var dt = new DataTable();
      dt.Columns.Add("Timestamp", typeof(DateTime));
      dt.Columns.Add("Value1", typeof(double));
      dt.Columns.Add("Value2", typeof(double));
 
      for (int i = 0; i < 20; i++)
      {
        var obj = new object[3];
        obj[0] = DateTime.Now.AddHours(i);
        obj[1] = i;
        if (i % 2 != 0)
          obj[2] = i + 1;
        else
          obj[2] = null;
        dt.Rows.Add(obj);
      }
 
      chart.ItemsSource = dt;
 
      SeriesMapping seriesMapping = new SeriesMapping();
      seriesMapping.SeriesDefinition = new LineSeriesDefinition();
      seriesMapping.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.XValue,
        FieldName = "Timestamp",
        FieldType = typeof(DateTime)
      });
      seriesMapping.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.YValue,
        FieldName = "Value1",
        FieldType = typeof(double)
      });
      chart.SeriesMappings.Add(seriesMapping);
       
      SeriesMapping seriesMapping1 = new SeriesMapping();
      seriesMapping1.SeriesDefinition = new LineSeriesDefinition();
      seriesMapping1.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.XValue,
        FieldName = "Timestamp",
        FieldType = typeof(DateTime)
      });
      seriesMapping1.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.YValue,
        FieldName = "Value2",
        FieldType = typeof(double)
      });
      chart.SeriesMappings.Add(seriesMapping1);
    }
  }


When you try this you will see that the second Series looks a bit strange because it added 0 instead of ignoring the null value.

Is there a workaround for that? 
How can I fix this problem?

I am using Version: 2010.3.1110.35

Kind Regards
Michael
Michael
Top achievements
Rank 1
 answered on 19 Mar 2011
1 answer
64 views
Hi, 
I just have installed wpf q1 2011 trial version, and after I convert my project I noticed that horizontal alignment for some controls are not working (rad expander, border). They just don't respond to changing alignment, it is impossibly to stretch control inside some container(grid or border)...
Do You know something about  this strange behavior?
Nebojsa Danilovic
Tina Stancheva
Telerik team
 answered on 19 Mar 2011
2 answers
237 views
Hello,

I am using version 2010.3.1314.35.  I have a TreeView that binds to an ObservableCollection<>, and I am allowing dragging and dropping to move items around.  Everything works great and gets updated nicely (I am implementing INotifyPropertyChanged on my objects), except for the following:

When a user selects multiple items in the TreeView and attempts to drop them in between the same selected items.  The result is that the items completely disappear from view.  I have attached a screen capture to show what I am referring to.

I was hoping that there is an easy way to handle this, but maybe I have to add some custom logic to my RadDragAndDropManager.DropQueryEvent (or perhaps my PreviewDragEnded event) to prevent such an occurrence?  I'm trying to avoid having to check if the selected items are surrounding the target destination (which I assume is what is causing the disappearance).

Any help or direction on this would be greatly appreciated!

Cheers,
Mark
Mark
Top achievements
Rank 1
 answered on 19 Mar 2011
1 answer
115 views
Does RichTextBox support track changes feature same as Microsoft Word does?
I need to compare previously entered text with the newly entered data and show user what has been changed since last time.

I was wonder to see that it is available on RadTextEditor on web and not on WPF. I thoght it is more easy to implement it on WPF than on web.

Thanks,
Wajihuddin
Iva Toteva
Telerik team
 answered on 18 Mar 2011
2 answers
79 views
Hi,

When .NET 4 WPF going to be release?

Thanks

--Nodir
nodir
Top achievements
Rank 1
 answered on 18 Mar 2011
1 answer
117 views

Hi,
I'm very new on working with Telerik products.  The past few days i'm working with RadDataFilter and custom editors but I stuck with the following problem.

My custom editor is a usercontrol witch has a dependency property called SelectedDateRange of type DateRange. The DateRange is a class with two properties

 

Public Class DateRange

        Implements System.ComponentModel.INotifyPropertyChanged

 

#Region "INotifyPropertyChanged Implementation"

        Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

        Protected Sub OnPropertyChanged(ByVal propertyname As String)

            RaiseEvent PropertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyname))

        End Sub

#End Region

        Private _beginDate As Date?

        <DataMember()>

        Public Property BeginDate() As Date?

            Get

                Return _beginDate

            End Get

            Set(ByVal value As Date?)

                _beginDate = value

                OnPropertyChanged("BeginDate")

            End Set

        End Property

 

 

        Private _endDate As Date?

        <DataMember()>

        Public Property EndDate() As Date?

            Get

                Return _endDate

            End Get

            Set(ByVal value As Date?)

                _endDate = value

                OnPropertyChanged("EndDate")

            End Set

        End Property

 

        Public Function HasRange() As Boolean

            Return BeginDate.HasValue Or EndDate.HasValue

        End Function

 

    End Class

 

Using your example i'm trying to bind the SelectedDateRange with the Value Property of the FilterDescriptor using the following statement

<DataTemplate x:Key="DateRangeBlockEditor">

            <AhsSysUIControls:DateRangeBlock SelectedDateRange="{Binding Value,Mode=TwoWay}" />

        </DataTemplate>

It seems that this doesn't work as i get always an unsetValue. The bottom line is that i want the FilterDescriptor to carry the DateRange because later i iterate all the FilterDescriptors to create an SQL where statement. Any ideas?

Thanks Sotiris

Rossen Hristov
Telerik team
 answered on 18 Mar 2011
1 answer
73 views
I seem to be getting an error when trying to filter on a Number column and first typing the period characater for a decimal point. I can recreate it in your Demo program by going to the GridView > Click Events Demo and typing a period(.) in the UnitPrice filter.

Any work arounds to fix this?

The call stack I got was:
at Telerik.Windows.Controls.MaskedTextBox.NumericMaskHandler.GetPointPosition()
   at Telerik.Windows.Controls.MaskedTextBox.NumericMaskHandler.Insert(Char insertion)
   at Telerik.Windows.Controls.MaskedTextBox.NumericMaskHandler.Insert(String insertion)
   at Telerik.Windows.Controls.RadMaskedTextBox.TextBox_TextChanged()
   at Telerik.Windows.Controls.MaskedTextBox.ExtendedTextBox.ExtendedTextBox_TextChanged(Object sender, TextChangedEventArgs 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.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.Primitives.TextBoxBase.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
   at System.Windows.Controls.TextBox.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
   at System.Windows.Documents.TextContainerChangedEventHandler.Invoke(Object sender, TextContainerChangedEventArgs e)
   at System.Windows.Documents.TextContainer.EndChange(Boolean skipEvents)
   at System.Windows.Documents.TextRangeBase.EndChange(ITextRange thisRange, Boolean disableScroll, Boolean skipEvents)
   at System.Windows.Documents.TextRange.ChangeBlock.System.IDisposable.Dispose()
   at System.Windows.Documents.TextEditorTyping.DoTextInput(TextEditor This, String textData, Boolean isInsertKeyToggled, Boolean acceptControlCharacters)
   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.TextCompositionManager.UnsafeCompleteComposition(TextComposition composition)
   at System.Windows.Input.TextCompositionManager.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.TextCompositionManager.UnsafeStartComposition(TextComposition composition)
   at System.Windows.Input.TextCompositionManager.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.HwndKeyboardInputProvider.ProcessTextInputAction(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   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)
Tina Stancheva
Telerik team
 answered on 18 Mar 2011
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?