Telerik Forums
UI for WPF Forum
1 answer
310 views
Telerik support,

I have a RadTreeView that is populated with DataBinding to an XML data file.  I use a Hierarchical DataTemplate in the XAML code to populate the Tree.  I would like to use the following in the C# code-behind to delete elements with the delete key.  This works fine for all of the first-level nodes in the Tree.  I would like to be able to select child items also and delete them in the same way.  The child items are created with DragAndDrop.

Here is the code to delete the parent items:

void MyView_KeyDown(object sender, KeyEventArgs e)
        {          
            if (e.Key.Equals(Key.Delete))
            {
                IList source = this.MyView.ItemsSource as IList;
                source.Remove(MyView.SelectedItem);                               
            }
        }

How can I change this to delete the child items also?  I have looked at some of the examples in the forum, and I found

foreach

 

 

(MyItem item in MyView.ItemsSource)

 

 

    {

 

 

 

    foreach (MyItem child in item.Children)

 

 

        {

 

            source.Remove(MyView.SelectedItem);

 

        }

 

    }


but I don't know what to use for item.Children in the 2nd foreach statement if this is the best way to find all child nodes.

Thanks,
Scott
Scott
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
115 views
Hello telerik-Team,

Starting-Situation:
Adding more as you can see(in the ScrollViewer) to the TabControl.
http://theupload.co.de/images/1_bitab.JPG

Problem:
If you add an item, the ScrollViewer don't scroll to the last item you have just added.
You have to scroll manual with the scroll arrow to the last item.
http://theupload.co.de/images/2_bitab.JPG
I hope you understand my problem.

Question:
How could i solve this problem.
Petar Mladenov
Telerik team
 answered on 14 Jun 2011
2 answers
135 views
I have some data with many columns, which usually displays with a horizontal scroll bar.  But when the user edits a row, I would like all of the columns to be on the screen at once for that row.   

Is there a way to fold a row with many columns so that it continues on one or more lines?   If so, could the continuation line(s) have column headings?
Troy Goddu
Top achievements
Rank 1
 answered on 14 Jun 2011
4 answers
232 views
Hi,
I use event 'Filtered' to capture a user column filtering.

I want send this filter over the wire (WCF) to a server and call a query there.

the problem is to serialize DistinctValuesFilterDescriptor ...

Do you provide any solution how to use DistinctValuesFilterDescriptor and send it over the WCF ...

thanks in advance

Robert



Robert
Top achievements
Rank 1
 answered on 14 Jun 2011
2 answers
409 views
I have a RadDateTimePicker control in a view that is bound to a datetime property in the associated viewmodel using the SelectedValue of the RadDateTimePicker. When the user selects a date and / or time, the datetime property in the viewmodel is set accordingly. However, if the user subsequently clears the input and the default 'Enter date' text is displayed in the control, the datetime property in the viewmodel is not set to null / mindatetime.

How can I implement the RadDateTimePicker so that if a user clears the datetime from the control the SelectedValue becomes null or mindatetime?
Yana
Telerik team
 answered on 14 Jun 2011
3 answers
356 views

The following was my code.

<telerik:RadGridView.Columns>
	<telerik:GridViewDataColumn Header="ID" UniqueName="colID" DataMemberBinding="{Binding Id}" IsVisible="False"  />
<telerik:GridViewImageColumn Header="Photo"  UniqueName="colImage" DataMemberBinding="{Binding ProductImage}" ImageHeight="20" ImageWidth="20"/>
<telerik:GridViewDataColumn  Header="Product Name" UniqueName="colDisplayName" DataMemberBinding="{Binding ProductName}"/>
</telerik:RadGridView.Columns> I have some requirement i.e Instead of showing "Product Image" and "Product Name" in two different columns i want show both in one column. like photo +"space" + its name. Regards Naresh Mesineni


naresh
Top achievements
Rank 1
 answered on 14 Jun 2011
0 answers
132 views
I have some problem.I am showing data in Nested Gridview .i.e when I select gridview row again I am showing nested grid with some details.
But I have some problem.when I click on + symbol data is not loading.when I click on row data is loading.
please help me in this matter.

Regards
Naresh Mesineni
naresh
Top achievements
Rank 1
 asked on 14 Jun 2011
2 answers
135 views
Got a little issue, installing the latest version, not to mention, the tool box is a bit of a mess, as the items repeats it self, also another issue i have notice, when i create a new project base on telerik i don't see the theme tab, is that normal?
i am ruining vs 2010 ultimate, any help would be great

cheers

Jason
Jason
Top achievements
Rank 2
 answered on 14 Jun 2011
1 answer
104 views
Hi,

I would like to know if it's possible to display pdf document into a Carousel?

1. Having each pdf pages as a CarouselItem

or

2. Having a pdf document and all of it's content into a CarouselItem

Actually, it's possible in my situation to have multiple pdf documents, that's why I'm planning to use a Carousel

Thank's
Milan
Telerik team
 answered on 14 Jun 2011
7 answers
141 views
This sample raises NullReferenceException in tha AxisX.CalculateItemRange method

View:
<Window.Resources>

        <DataTemplate x:Key="measTemplate">
            <telerik:RadChart ItemsSource="{Binding ChartData, Mode=OneWay}" >
                <telerik:RadChart.DefaultView>
                    <telerik:ChartDefaultView>
                        <telerik:ChartDefaultView.ChartLegend>
                            <telerik:ChartLegend UseAutoGeneratedItems="True" Header=" " x:Name="chartLegend">
                            </telerik:ChartLegend>
                        </telerik:ChartDefaultView.ChartLegend>
                        <telerik:ChartDefaultView.ChartArea>
                            <telerik:ChartArea LegendName="chartLegend" EnableAnimations="True">
                                <telerik:ChartArea.AxisX>
                                    <telerik:AxisX />
                                </telerik:ChartArea.AxisX>
                                <telerik:ChartArea.AxisY>
                                    <telerik:AxisY DefaultLabelFormat="F2"/>
                                </telerik:ChartArea.AxisY>
                                <telerik:ChartArea.AdditionalYAxes>
                                    <telerik:AxisY AxisName="Secondary" DefaultLabelFormat="F2"/>
                                </telerik:ChartArea.AdditionalYAxes>
                            </telerik:ChartArea>
                        </telerik:ChartDefaultView.ChartArea>
                    </telerik:ChartDefaultView>
                </telerik:RadChart.DefaultView>
                <telerik:RadChart.SeriesMappings>
                    <telerik:SeriesMapping LegendLabel="R">
                        <telerik:SeriesMapping.SeriesDefinition>
                            <telerik:LineSeriesDefinition ShowItemLabels="False" AxisName="Secondary"/>
                        </telerik:SeriesMapping.SeriesDefinition>
                        <telerik:ItemMapping FieldName="ValueY" DataPointMember="YValue"/>
                        <telerik:ItemMapping FieldName="ValueX" DataPointMember="XValue"/>
                    </telerik:SeriesMapping>
                    <telerik:SeriesMapping LegendLabel="C">
                        <telerik:SeriesMapping.SeriesDefinition>
                            <telerik:LineSeriesDefinition ShowItemLabels="False"/>
                        </telerik:SeriesMapping.SeriesDefinition>
                        <telerik:ItemMapping FieldName="ValueY1" DataPointMember="YValue"/>
                        <telerik:ItemMapping FieldName="ValueX" DataPointMember="XValue"/>
                    </telerik:SeriesMapping>
                </telerik:RadChart.SeriesMappings>
            </telerik:RadChart>
        </DataTemplate>
    </Window.Resources>
    <DockPanel>
        <ItemsControl ItemsSource="{Binding Context.Charts}" ItemTemplate="{StaticResource measTemplate}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid Columns="1" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
    </DockPanel>

View CodeBehind 
public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Context = new Context();
            this.DataContext = this;
        }
 
 
        public Context Context { get; set; }
    }
 
 
    public class Context
    {
        public Context()
        {
            this.Charts = new ObservableCollection<ChartDataHolder>();
            for (int i = 0; i < 2; i++)
            {
                this.Charts.Add(new ChartDataHolder());
            }
        }
 
 
        public ObservableCollection<ChartDataHolder> Charts { get; private set; }
    }


ViewModel:
public class ChartDataHolder
    {
        private readonly BackgroundWorker worker = new BackgroundWorker();
 
        public ChartDataHolder()
        {
this.ChartData = new ObservableCollection<ChartDataItem>();
            worker.DoWork += this.worker_DoWork;
            this.worker.RunWorkerAsync();
 
        }
 
        void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            Thread.Sleep(TimeSpan.FromSeconds(1)); //!! Without it it works fine
            while (true)
            {
                for (int i = 0; i < 2; i++)
                {
                    Application.Current.Dispatcher.BeginInvoke(new Action(this.ProcessResult), null);
                }
                Thread.Sleep(TimeSpan.FromSeconds(5));
            }
        }
 
        private void ProcessResult()
        {
            this.ChartData.Clear();
            for (int i = 0; i < 20; i++)
            {
                this.ChartData.Add(new ChartDataItem() { ValueX = DateTime.Now.Second + i, ValueY = DateTime.Now.Second + i });
            }
        }
 
        public ObservableCollection<ChartDataItem> ChartData { get; private set; }
    }
Ves
Telerik team
 answered on 14 Jun 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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?