Telerik Forums
UI for WPF Forum
2 answers
172 views
Hi,
I'm  trying to display two datatypes in a RadTreeListView through XML. The first datatype, 'Director', with two properties: 'Name', and a property 'Function' . Function contains two properties i.e Name and FunctionType.


--------------------------------------------------------------------------------------------------
public
class Director
{
    public string Name{ get; set; }
    public ObservableCollection<Function > Function { get; set; }
}
 
public class Function
{
    public string Name { get; set; }
    public string FunctionType{ get; set; }
 }

 

 

 

<Window.Resources>

 

 

 

<local:RadTreeListXmlDataSource x:Key="TreeSource" Source="TestData.xml" />

 

 

 

 

 

</Window.Resources>

 

 

 

 

 

 

 

  <telerik:RadTreeListView CellEditEnded="RadTreeListView1_CellEditEnded" x:Name="RadTreeListView1" RowIsExpandedChanged="RadTreeListView1_RowIsExpandedChanged"

 

 

 

 

  AutoGenerateColumns="False" ItemsSource="{StaticResource TreeSource}">

 

 

 

 

  <telerik:RadTreeListView.ChildTableDefinitions>

 

 

 

 

  <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />

 

 

 

 

  </telerik:RadTreeListView.ChildTableDefinitions>

 

 

 

 

  <telerik:RadTreeListView.Columns>

 

 

 

 

  <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />

 

 

 

 

  <telerik:GridViewDataColumn DataMemberBinding="{Binding Source}" Header="Type" />

 

  

 

</telerik:RadTreeListView.Columns>

 

 

 

 

</telerik:RadTreeListView>

 




-------------------------------------------------------------------------------------------------

I was able to edit the Director's properties but when I tried to edit Function's properties i.e Funnction Name ,
I got an error saying "Object does not match target type".
Can you please provide a sample for the above functionality?


Sharada
Top achievements
Rank 1
 answered on 22 Mar 2011
2 answers
155 views
In other products, I had a ValuePath property and Value property, which allowed me to specify
1. The property of the lookup collection to use for the identifier of the value on the data context (ValuePath)
2. The value of the item in the data context, uh, (Value)

I assume SelectedValue is the property for Value?

Is there a ValuePath property? How do I specify that StateId from a State collection bound to the radcombo is the property to use for StateId on a Address object?

Thanks,

Morgan
Morgan
Top achievements
Rank 1
 answered on 22 Mar 2011
1 answer
104 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
139 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
216 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
284 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
77 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
267 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
136 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
104 views
Hi,

When .NET 4 WPF going to be release?

Thanks

--Nodir
nodir
Top achievements
Rank 1
 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
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?