Telerik Forums
UI for WPF Forum
3 answers
143 views
I'm working on application using Prism and yours Q3 WPF controls. Unfortunately when I'm trying to dock control in another dock region the InvalidOperationException is thrown. Exception message says I should use ItemsControl.ItemsSource instead of ItemsSource and I really don`t known how to solve this.

Below you'll find my region adapter class, dockable view class and docking container declaration in main window

Region adapter
namespace LTD.Desktop.Common 
    public class RadPaneGroupRegionAdapter : RegionAdapterBase<RadPaneGroup> 
    { 
        public RadPaneGroupRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory) 
            : base(regionBehaviorFactory) 
        { 
        } 
 
        protected override void Adapt(IRegion region, RadPaneGroup regionTarget) 
        { 
            region.Views.CollectionChanged += (s, e) => 
            { 
                switch (e.Action) 
                { 
                    case NotifyCollectionChangedAction.Add: 
                        foreach (var item in e.NewItems.OfType<RadPane>()) 
                        { 
                            regionTarget.AddItem(item, Telerik.Windows.Controls.Docking.DockPosition.Center); 
                        } 
                        break
                    case NotifyCollectionChangedAction.Remove: 
                        foreach (var item in e.OldItems.OfType<RadPane>()) 
                        { 
                            item.RemoveFromParent(); 
                        } 
                        break
                    case NotifyCollectionChangedAction.Replace: 
                        { 
                            var oldItems = e.OldItems.OfType<RadPane>(); 
                            var newItems = e.NewItems.OfType<RadPane>(); 
                            var newItemsEnumerator = newItems.GetEnumerator(); 
                            foreach (var oldItem in oldItems) 
                            { 
                                var parent = oldItem.Parent as ItemsControl; 
                                if (parent != null && parent.Items.Contains(oldItem)) 
                                { 
                                    parent.Items[parent.Items.IndexOf(oldItem)] = newItemsEnumerator.Current; 
                                    if (!newItemsEnumerator.MoveNext()) 
                                    { 
                                        break
                                    } 
                                } 
                                else 
                                { 
                                    oldItem.RemoveFromParent(); 
                                    regionTarget.Items.Add(newItemsEnumerator.Current); 
                                } 
                            } 
                        } 
                        break
                    case NotifyCollectionChangedAction.Reset: 
                        regionTarget 
                            .EnumeratePanes() 
                            .ToList() 
                            .ForEach(p => p.RemoveFromParent()); 
                        break
                    default
                        break
                } 
            }; 
 
            foreach (var view in region.Views.OfType<RadPane>()) 
            { 
                regionTarget.Items.Add(view); 
            } 
        } 
 
        protected override IRegion CreateRegion() 
        { 
            return new AllActiveRegion(); 
        } 
    } 

Dockable view
namespace LTD.Examples.Modularity.Views 
    /// <summary> 
    /// Interaction logic for ExampleView.xaml 
    /// </summary> 
    public partial class ExampleView : RadDocumentPane 
    { 
        public ExampleView() 
        { 
            InitializeComponent(); 
        } 
    } 

<telerik:RadDocumentPane x:Class="LTD.Examples.Modularity.Views.ExampleView" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    Header="Example panel"/> 
 

ExampleView class in design time also generate en error: Could not create an instance of type 'RadDocumentPane'

Views container:
<!-- Workspaces container --> 
        <telerik:RadDocking Name="Workspaces" DockPanel.Dock="Bottom" cal:RegionManager.RegionName="Workspaces"
            <telerik:RadDocking.DocumentHost> 
                <telerik:RadSplitContainer> 
                    <telerik:RadPaneGroup cal:RegionManager.RegionName="MainRegion" /> 
                </telerik:RadSplitContainer> 
            </telerik:RadDocking.DocumentHost> 
        </telerik:RadDocking> 

It's critical for me, so I'll be appreciate for any help.

Regards,
MC.
Maciej Czerwiakowski
Top achievements
Rank 1
 answered on 17 Dec 2009
1 answer
148 views
How do we commit the changes made to data in a datagrid when using a dataset as a datasource.?

Ive tried using the tableapapter.update()
and
the radgridview.commitchanges()
methods but the changes are not persisted to the database.

Do we need to use the Telereik ORM (which I have never looked at)..will ORM work with access MDB's?

or should I work towards updating my access to sql and use entity models. (of which I have spent some time working so I'm familiar with it) ??
then just use the context.save() and let entity framework handle the plumbing

Suggestions, advice..Success/horror stories? 
Nedyalko Nikolov
Telerik team
 answered on 17 Dec 2009
1 answer
106 views
I'd like to bind SelectTime to a DateTime value, how can I do this ?
4ward s.r.l.
Top achievements
Rank 1
 answered on 17 Dec 2009
1 answer
93 views
I watched the "What's new" and saw the Ctrl-Home and End but I am wondering if the arrow navigation made it into the current relase?

Thanks,
-Sid.
Nedyalko Nikolov
Telerik team
 answered on 17 Dec 2009
1 answer
129 views
I was wondering if someone of the Telerik team could post the entire code project of the example given at http://www.telerik.com/help/wpf/gridview-selection-via-checkbox.html.

Thanks in advance.
Milan
Telerik team
 answered on 17 Dec 2009
1 answer
97 views
So, here is my problem.
I am new to teleric RadCharts for WPF and I wanted to draw a chart that has points who have 
1. Different shapes based on their values
2. Different animated tooltips when the user hovers over them (again) based on their values

Is this possible to do? Can some one please walk me through an approach?

Thanks
Giuseppe
Telerik team
 answered on 17 Dec 2009
3 answers
90 views
Hello.  I'm using the RadNumericUpDown for entering measurements.  I've set the control's decimal places property to 3 (using a binding to a business object property).  when the control has no value (meaning the value I'm binding to is null), and the control's text itself is empty, the user is able to enter a number such as ".890" without the leading 0.  However, when there is already a value in the control, such as "123.432" and the user selects the control, either by tab or by mouse click.  THe user must type in a leading 0 in order to enter a value less then 1, such as "0.890".

My client wants to be able to enter values without needing a leading 0.  I've tried handling the "GotFocus" event, and clearing the RadNumericUpDown.ValueProperty, or setting my business object's binded value to null.  However, these changes do not take effect until the user leaves the control.  Thus we get the weird behavior of the control clearing when the user leaves the control, instead of when they enter it.

Any ideas would be great.  Thanks

Joshua
Boyan
Telerik team
 answered on 17 Dec 2009
3 answers
362 views
Hi Team,

I want to align content of RadNumericUpDown to Left align. I have tried HorizontalContentAlignment="Left", but it doesn't work. Please suggest needful.

Thanks.

Sample:
File name: window1.xaml
XAML Content:
<Window x:Class="TelerikUpDown.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    Title="Window1" Height="300" Width="300">
    <Grid>
        <telerik:RadNumericUpDown Name="NumUpDown" Height="25"
                                  HorizontalContentAlignment="Left"
                                  SmallChange="1" Minimum="1" Maximum="10" Value="2"
                                  BorderThickness="0" LargeChange="5" ValueFormat="Numeric"
                                  Width="150">
        </telerik:RadNumericUpDown>
    </Grid>
</Window>
Dimitrina
Telerik team
 answered on 17 Dec 2009
2 answers
128 views

For some strange reason, the gridview edit mode for a column that is string binded, accepts only numeric values. What could be wrong

 <telerik:RadGridView Name="rgvSiteDetails" Margin="10,10,10,10" Height="340" RowIndicatorVisibility="Collapsed"   
                    ShowGroupPanel="False" AutoGenerateColumns="False" Visibility="Visible" Background="Transparent" 
                    AutoGenerateHierarchyFromDataSet="False" BorderBrush="LightGray" CanUserFreezeColumns="False" CanUserInsertRows="False" 
                    HorizontalContentAlignment="Stretch" ShowColumnHeaders="True" IsFilteringAllowed="False"   
                    VerticalGridlinesBrush="LightGray" > 
                    <telerik:RadGridView.Columns> 
                        <telerik:GridViewDataColumn UniqueName="IsSelected" DataMemberBinding="{Binding IsSelected}" Header="" Width="30" /> 
                        <telerik:GridViewDataColumn UniqueName="SiteSequence" Header="" Width="30" DataMemberBinding="{Binding SiteSequence}" /> 
                        <telerik:GridViewDataColumn UniqueName="SiteName" Header="SiteName" DataMemberBinding="{Binding SiteName}"  Width="120" /> 
                        <telerik:GridViewDataColumn UniqueName="SiteShortName" Header="SiteShortName" DataMemberBinding="{Binding SiteShortName}"  Width="120"/>  
                        <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="ReceivedDate" IsVisible="True" Header="Received Date" Width="80"  DataMemberBinding="{Binding ReceivedDate}"  /> 
                        <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="PatientLastName" Header="Patient Last Name" IsVisible="True" Width="120"  DataMemberBinding="{Binding PatientLastName}"  /> 
                          
                        <telerik:GridViewDataColumn x:Name="gdcCassetteId" UniqueName="CassetteID" IsVisible="False" Header="Cassette Id" Width="80"  DataMemberBinding="{Binding CassetteID}" /> 
                          
                        <telerik:GridViewDataColumn x:Name="gdcSlideId" UniqueName="DisplayName" Header="Display Name" IsVisible="False" DataMemberBinding="{Binding DisplayName}"  /> 
                        <telerik:GridViewDataColumn x:Name="gdcDisplayName" UniqueName="DisplayName" Header="Display Name" IsVisible="False" DataMemberBinding="{Binding DisplayName}"  /> 
                        <telerik:GridViewDataColumn x:Name="gdcProcedureName" UniqueName="ProcedureName" Header="Procedure Name" IsVisible="False" DataMemberBinding="{Binding DisplayName}"  /> 
                        <telerik:GridViewDataColumn x:Name="gdcLevelInfo" UniqueName="LevelInfo" Header="Level Info" IsVisible="False" DataMemberBinding="{Binding DisplayName}"  /> 
                        <telerik:GridViewDataColumn x:Name="gdcmagazineid" UniqueName="magazineid" IsVisible="False" Header="Magazine Id"  DataMemberBinding="{Binding magazineid}"  /> 
                        <telerik:GridViewDataColumn x:Name="gdcbin" UniqueName="bin" Header="Exit Bin" IsVisible="False"   DataMemberBinding="{Binding bin}"  /> 
 
                    </telerik:RadGridView.Columns> 
                </telerik:RadGridView> 
Below is the code behind

private void rgvSiteDetails_CurrentCellChanged(object sender, GridViewCurrentCellChangedEventArgs e)  
        {  
            this.rgvSiteDetails.BeginEdit();  
        } 
 SharedData.lstSelectedCaseData = new ObservableCollection<SharedData.SelectedCaseData>();  
 
                rgvSiteDetails.DataLoaded += new EventHandler<EventArgs>(rgvSiteDetails_DataLoaded);  
               foreach (CaseDataCase item in SharedData.objCurrent.Items)  
                        {  
                            if (item.Specimen != null)  
                                foreach (CaseDataCaseSpecimen item2 in item.Specimen)  
                                {  
                                    SharedData.SelectedCaseData a = new SharedData.SelectedCaseData();  
                                    a.CaseId = item.CaseId;  
                                    a.AccessionNumber = item.AccessionNumber;  
                                    a.ReceivedDate = item.ReceivedDate;  
                                    a.PatientLastName = item.Patient[0].PatientLastName;  
                                    a.IsSelected = true;  
                                    a.SiteName = item2.SiteName;  
                                    a.SiteSequence = item2.SiteSequence;  
                                    a.SiteShortName = item2.SiteShortName;  
                                    a.SiteID = item2.SiteID;  
                                    SharedData.lstSelectedCaseData.Add(a);         
                                }  
                              
                        }  
                        rgvSiteDetails.ItemsSource = SharedData.lstSelectedCaseData; 

void rgvSiteDetails_DataLoaded(object sender, EventArgs e)  
        {  
            try 
            {  
                SharedData.Log.Info("Entering rgvSiteDetails_DataLoaded");  
                rgvSiteDetails.ExpandAllGroups();  
                SharedData.Log.Info("Exiting rgvSiteDetails_DataLoaded");  
            }  
            catch (Exception ex)  
            {  
                SharedMethods.HandleExceptions(ex);  
            }  
              
        } 

Any help would be highly appreciated.
Pooran
Pooran
Top achievements
Rank 1
 answered on 17 Dec 2009
2 answers
131 views
Hi, so I'm wondering how I can check for that and disable the drop under some circumstances. I've already tried all the drag and drop events that make sense to me in the TreeView (DragEnter, DragStarted DragOver, PreviewDragEnter, PreviewDragStarted, PreviewDragOver), so when I start dragging and I move the dragged object around, none of this events get fired. I also tried an approach with the RadDragAndDropManager here:


But to my surprise, the OnDropInsideTreeViewDropQuery event never got fired. Am I missing something here?

What I want to do is pretty simple. I have several types of objects in my treeview, say:

Junkyards
    Junkyard 1
         Cars
            Toyota Corola
            Nissan Sentra
         Furniture
            Stove
            Desk
         Computers
            Dell Inspiron
            HP a2921
    Junkyard 2
         Cars
            Toyota Corola
            Nissan Sentra
         Furniture
            Stove
            Desk
         Computers
            Dell Inspiron
            HP a2921

So if the user drags a car from Junkyard1 to Junkyard2 and hovers it over Computers, basically I wan't to show a NO cursor, but if he does drag it over the Cars node, then it should allow him to drop there. The Junkyards cannot be dragged, so I need to check if the user is trying to drag a Junkyard and not allow him to.

Please keep in mind that I'm not doing the TreeView filling in code or XAML, the data is coming from an XML document, so I can't just go to each RadTreeViewItem and set the IsDropAllowedProperty to false, it has to be done programmatically through the events.

Thanks!
Lauren Nickerson
Top achievements
Rank 1
 answered on 16 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?