Telerik Forums
UI for WPF Forum
2 answers
173 views

Hi

I have a requirement where i need to pass in a custom formatter for values in a GridViewDataColumn. I looked at DataFormatString but i don't think it satisfies my requirement.My requirement is that i need to round the decimal to 4 decimal places but also show a negative sign if the number is negative. For example, if the number is -0.000001, then my grid should show -0.0000 and not just 0.0000. For a positive number, it should just display 0.0000. How do i get this working? Any help is much appreciated.

 

Thanks

Vinoth

Vinoth Kathappanraju
Top achievements
Rank 1
 answered on 28 Jun 2016
3 answers
274 views
Hello,

I made a sample MVVM project where I have a ViewModel for my nodes:
public class WarehouseItem : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
 
        private bool isExpanded;
        private string name;
        private IList<WarehouseItem> m_items;
 
        public WarehouseItem(string name, int count, bool isExpanded = true)
        {
            this.Name = name;
            this.IsExpanded = isExpanded;
            this.Items = (from l_i in System.Linq.Enumerable.Range(0, count)
                          select new WarehouseItem("SubItem" + (l_i + 1), 0, false)).ToList();
        }
 
        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                if (value != this.name)
                {
                    this.name = value;
                    this.OnPropertyChanged("Name");
                }
            }
        }
 
        public bool IsExpanded
        {
            get
            {
                return this.isExpanded;
            }
            set
            {
                if (value != this.isExpanded)
                {
                    this.isExpanded = value;
                    this.OnPropertyChanged("IsExpanded");
                }
            }
        }
 
        public IList<WarehouseItem> Items
        {
            get { return this.m_items; }
            set
            {
                if (this.m_items != value)
                {
                    this.m_items = value;
                    this.OnPropertyChanged("Items");
                }
            }
        }
 
        protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, args);
            }
        }
 
        private void OnPropertyChanged(string propertyName)
        {
            this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
        }
    }


I have bound the IsExpanded property to a property of my ViewModel like this:
<telerik:RadTreeListView IsExpandedBinding="{Binding IsExpanded, Mode=TwoWay}"
                         AutoGenerateColumns="False" ItemsSource="{Binding}">
    <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 IsExpanded}"
                            Header="Is Expanded" />
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>

And I was a little bit disappointed when I saw that if you add a node with a ViewModel where the IsExpanded property is already set to True, the node will be first collapsed than expanded.
If you have a lot of nodes and you refresh the state of the nodes frequently, it's really annoying.

Best regards,
Dilyan Traykov
Telerik team
 answered on 28 Jun 2016
12 answers
480 views
Hi,

Is there a way to create smooth scrolling between the items with touch screen?
The animation should have acceleration and friction. Like iPhone has.

Someone already asked for this animation two years ago, so i'm wondering if this option was implemented (before I'll try to work with mouse events and calculating the speed delta myself) or is there any solution for this case?

Regards,
Yevgeniy Kiveisha


Yoan
Telerik team
 answered on 28 Jun 2016
3 answers
152 views

Hi,
I am having 5 RadGroup inside  RadSplitContainer in my View and data binding is happening through using PRISM and MVVM.
When the RadGroup is getting pinned and unpinned, that particular RadGroup is moving to last in the sequence.
I don't want this behavior. I want the group show in the same sequence as it is declared in XAML.

Please suggest how I can achieved this.
--
Thanks & Regrads

Manoj S

Polya
Telerik team
 answered on 28 Jun 2016
3 answers
162 views

Hellow,

 

When deleting the selected row in RadGridView, the selection changes automatically to another row. How can I cancel this behaviour ?

There are "Deleted" and "Deleting" events indeed, but they are fired only following a user's deletion. In my case, the deletion is made following a change in the ItemsSource collection.

Stefan Nenchev
Telerik team
 answered on 28 Jun 2016
3 answers
1.2K+ views

I am using RadMaskedNumericInput, I have set the max and min and i have allow null to true, I want the users to be able to delete everything in the text box. But the first time user hit backspace it puts a zero in the text box, if i hit backspace again it will remove the zero.

is there i way to prevent the first zero.

And the interesting thing is that the binding value is set to null the first time i hit backspace, so the UI is 0 but the binding value is null, then when i hit backspace again to get rid of 0 the setter is never called.

Thanks

Vikas Mittal

 

<telerik:RadMaskedNumericInput Mask="" MaskedInput:MaskedInputExtensions.Maximum="99999999"
            TextMode="MaskedText" MaskedInput:MaskedInputExtensions.AllowNull="True" 
            Width="100" IsClearButtonVisible="False" Height="30" HorizontalAlignment="Center"
            MaskedInput:MaskedInputExtensions.Minimum="1"
            Style="{StaticResource SvtRadMaskedNumericInputStyle}" Value="{Binding Frequency, NotifyOnValidationError=True}"/>

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Jun 2016
9 answers
172 views

Hi! In my WPF MVVM application I'm in need of presenting of hierarchical information in RadPropertyGrid without use of built-in collections editor. The hierarchical information in RadPropertyGrid must be presented approximately in the following manner:

- "Sirius" Gas Flowmeter
    - Settings
        - Real-Time Clock
             TimeZone                         0
             Date                             20062016
             Time                             163716
    - SerialInterface
         BusAddress                             1
         BaudRate                               115200
    - GasFlowProfileCorrection
         - CompensationUltrasonicBeamFailure
              CompensationWeight              12000
         Weight_1                               0.00015
         Correction_1                           0

Where '-' character on the left of group name means that the content disclosed and other groups and registers in this group are shown (when the content is minimized then '-' character is changed to '+' character). Nesting depth is initially unknown and is determined during runtime of the application. The datasource for the RadPropertyGrid is an ObswervableCollection with hierarchical data items. The contents of the collection is formed during runtime of the application. I watched post about hierarhical RadPropertyGrid at: http://www.telerik.com/forums/hierarchical-collections and your application example from this post. But as I understood there is considered a fixed depth of nesting, which is known in advance. But as I wrote above - in my case nesting depth is initially unknown and is determined during runtime.  If you give me an example applicable to my case, it will be great. I am hope for your help.
Eugene
Top achievements
Rank 1
 answered on 28 Jun 2016
1 answer
123 views

I am using the ScheduleView component with the timeline view.

I can set the current date and start time, but how do I zoom to a specific time range, so that on the left I have (for example) 9am and on the right I have 5pm?

Thanks

Kalin
Telerik team
 answered on 28 Jun 2016
1 answer
239 views

Dear team,

for some reason I have a collection of MemberColumnFilterDescriptors and I must apply these filters to a List in my ViewModel. It exists a way to do that? Maybe creating a "where" predicate to include in a linq or something?

Thanks in advance

Martin
Telerik team
 answered on 27 Jun 2016
1 answer
133 views

Hi,

 

I'm trying to close a floating pane then open another window on top of my main form, however the main form being activated once the floating pane is closed resulting in the 2nd form being hidden. Setting the 2nd form to topmost isn't a solution for my requirements. How can I prevent the focus moving back to the main window's docking control?

Here is the xaml code:

<telerik:RadDocking x:Name="radDocking" BorderThickness="0" Padding="0" >
    <telerik:RadSplitContainer x:Name="WorkflowWindowContainer" InitialPosition="FloatingOnly" telerik:RadDocking.FloatingLocation="1250, 700" telerik:RadDocking.FloatingSize="600,250">
        <telerik:RadPaneGroup >
            <telerik:RadPane Header="Floater" x:Name="floatingPane" ContextMenuTemplate="{x:Null}" CanUserClose ="True" IsHidden="False" >
                <Label Content="I'm a floating window"></Label>
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
</telerik:RadDocking>

Code behind:

floatingPane.IsActive = false;
floatingPane.IsHidden= true;
SecondWindow window = new SecondWindow();
window.Show();

Georgi
Telerik team
 answered on 27 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?