Telerik Forums
UI for WPF Forum
0 answers
100 views
Hi,

I had a requirement like this. I am having a radgridview in which I want a functionality like I should be able to insert a new row on Insert button click at whatever location I required like...

1. Below the selected row.
2. Above the selected row.

Can u please suggest me how to implement this...? Waiting for ur response...!!!

Thanks
Prakash.
Siva Prakash
Top achievements
Rank 1
 asked on 20 Sep 2011
4 answers
201 views

Hi,

I am using a RadGrid from Telerik RadControls for WPF. i have this requirement where by the header column should remain as it is, but the grid entries are required to merge cells as required. i am attaching an image, showing a sample of what i require. Can this be done in RadGrid? If so, how?
enter image description here

Siva Prakash
Top achievements
Rank 1
 answered on 20 Sep 2011
4 answers
1.9K+ views
Hey there-
I am attempting to AutoFit my GridView in a DockPanel, which is causing me difficulties. I have not set a height or width, but I have set a minimum and maximum width for when it resizes. My question is what snippet of code is need in order to AutoFit the GridView in a DockPanel. 
Thanks in advance,
Chris
Ryan
Top achievements
Rank 1
 answered on 19 Sep 2011
3 answers
174 views
Hi everybody,
I have a problem with a NumericUpDown inside the DataTemplate used for the ItemTemplate in the RadCarousel,
This is my data template:

<DataTemplate x:Key="PPRTypeTemplate">
        <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="3" CornerRadius="3">
        <Grid Height="Auto" Width="250">
        <Grid.RowDefinitions>
        <RowDefinition Height="30"/>
        <RowDefinition Height="20"/>
        <RowDefinition Height="100"/>
                        <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
<telerik:RadButton Width="50" 
Command="{Binding ElementName=LayoutRoot, Path=DataContext.CreateCommand}" 
CommandParameter="{Binding}"
ToolTip="Create PPR" 
HorizontalAlignment="Center"  >
<Image Source="../Images/wand.png"/>
</telerik:RadButton>
<Image Source="{Binding Image, Converter ={StaticResource ImageConverter}}" Grid.Row="2" Grid.RowSpan="1"></Image>
        <TextBlock Foreground="Black" HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding Description}" VerticalAlignment="Center" Grid.Row="1" FontSize="13.333" TextAlignment="Center"/>


                    <Border  Grid.Row="3" BorderThickness="0,3,0,0" BorderBrush="{StaticResource BorderBrush}">
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="Loop Type" TextAlignment="Center"
                                    Visibility="{Binding UseLoop, Converter={StaticResource BTVConv}}"/>
                        <ComboBox   SelectedItem="{Binding LoopType}"
                                                  Visibility="{Binding UseLoop, Converter={StaticResource BTVConv}}"
                                                  Margin="10,2,10,2"
                                                SelectedIndex="0"
                                    ItemsSource="{Binding Source={x:Type tools:NodeType},
                      Converter={StaticResource EnumToArrayConverter}}">
                        </ComboBox>
                        <TextBlock Text="Number of PS" TextAlignment="Center"
                                    Visibility="{Binding PSCount, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding PSCount, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding PSCount, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of PS Reference" TextAlignment="Center"
                                   Visibility="{Binding RefCount, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding RefCount, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding RefCount, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of Parallel Branches" TextAlignment="Center"
                                   Visibility="{Binding ParallelCount, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding ParallelCount, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding ParallelCount, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of PS in TRUE branch" TextAlignment="Center"
                                   Visibility="{Binding TrueCount, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding TrueCount, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding TrueCount, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of PS in FALSE branch" TextAlignment="Center"
                                   Visibility="{Binding FalseCount, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding FalseCount, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding FalseCount, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of PS before loop" TextAlignment="Center"
                                   Visibility="{Binding PSPreInnerLoop, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding PSPreInnerLoop, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding PSPreInnerLoop, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of PS inside loop" TextAlignment="Center"
                                   Visibility="{Binding PSInnerLoop, Converter={StaticResource TemplateParametersConverter}}"/>
                            <telerik:RadNumericUpDown Value="{Binding PSInnerLoop, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding PSInnerLoop, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>
                        <TextBlock Text="Number of nested PPRs" TextAlignment="Center"
                                   Visibility="{Binding NestCount, Converter={StaticResource TemplateParametersConverter}}"/>
                        <telerik:RadNumericUpDown Value="{Binding NestCount, Mode=TwoWay}" 
                                                  Minimum="1"
                                                  Visibility="{Binding NestCount, Converter={StaticResource TemplateParametersConverter}}"
                                                  NumberDecimalDigits="0"
                                                  Margin="10,2,10,2"/>


                    </StackPanel>
                    </Border>
                </Grid>
        </Border>
        </DataTemplate>

the value in the properties bounded in the NumericUpDown (in bold)
are not updated while im'changing the value in the control or on the lost focus event...
Instead if i change the control with a normal TextBox everything works, what i did wrong?
Thanks!

Ray
Claudio
Top achievements
Rank 1
 answered on 19 Sep 2011
3 answers
229 views
Hi,

Is it possible to add a new row on the keydown event and not lose focus in the cell the event was trapped in.  I know I can use gridView.BeginInsert(), but this causes focus to be lost from the cell that was being edited.  Specifically, we are trying to have an empty row, begin adding data to that row, while we are adding data to that row (only on the first keydown event of that row) we want a new (empty) row to appear and still have focus on the original row (cell) so we can continue adding data.

Also, on a related note, is adding an object to our ItemsSource bound collection the only way to have an empty last row in the GridView?

Thanks,

Mike
Nedyalko Nikolov
Telerik team
 answered on 19 Sep 2011
1 answer
96 views
Preferably through c# code as opposed to markup.

Thanks,

Anders, Denmark

PS: I have seen http://www.telerik.com/community/forums/wpf/docking/radpane-scrollbars.aspx but the appearance is standard windows and 'sticks out' compared to the generel, telerik-based layout of my application.
Konstantina
Telerik team
 answered on 19 Sep 2011
2 answers
264 views
Hello,

Im just trying to get a color background when I click on any radmenuitem.

I need to put it on app.xaml to do it general for all my menuitem controls.

Something like:
<Style x:Key="MenuItemOnClickColor" TargetType="{x:Type telerik:RadMenuItem}">
    <Style.Triggers>
        <Trigger Property="?????????">
            <Setter Property="Background" Value="Red" />
        </Trigger>
    </Style.Triggers>
</Style>

Thanks for your help.
Regards.

Konstantina
Telerik team
 answered on 19 Sep 2011
1 answer
321 views
Here is my code, but it could not work.
I want to show the detail row only for "Leaf" node, but not "Node" node. However, it hide everything.

<Window x:Class="TeleTree.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadTreeListView x:Name="radTreeListView" AutoGenerateColumns="False" IsReadOnly="True">
            
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewToggleRowDetailsColumn/>
                <telerik:GridViewDataColumn  DataMemberBinding="{Binding Name}" Header="Name" Width="100"/>
            </telerik:RadTreeListView.Columns>
            
            <telerik:RadTreeListView.RowDetailsTemplate>
                <DataTemplate>
                    <Grid x:Name="DetailGrid">
                        <StackPanel Orientation="Horizontal" Margin="0" Visibility="Collapsed">
                            <TextBlock Text="Type:"/>
                            <TextBox Text="{Binding Type}"/>
                        </StackPanel>
                    </Grid>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Type}" Value="Leaf">
                            <Setter TargetName="DetailGrid" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </telerik:RadTreeListView.RowDetailsTemplate>
        </telerik:RadTreeListView>
    </Grid>
</Window>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
 
namespace TeleTree
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.radTreeListView.ItemsSource = DataService.GetData();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
 
namespace TeleTree
{
    public class Node
    {
        public List<Node> Children = new List<Node>();
        public string Name;
        public string Type;
        
    }
 
    public class DataService
    {
        public static ObservableCollection<Node> GetData()
        {
            ObservableCollection<Node> list = new ObservableCollection<Node>();
 
            Node node1 = new Node()
            {
                Name = "Node1",
                Type = "Node"                
            };
 
            Node node1_1 = new Node()
            {
                Name = "Node1_1",
                Type = "Leaf"
            };
 
            Node node2 = new Node()
            {
                Name = "Node2",
                Type = "Node"
            };
 
            Node node2_2 = new Node()
            {
                Name = "Node2_2",
                Type = "Leaf"
            };
 
            node1.Children.Add(node1_1);
            node2.Children.Add(node2_2);
            list.Add(node1);
            list.Add(node2);
            return list;
        }
    }
}

Maya
Telerik team
 answered on 19 Sep 2011
7 answers
492 views
Hi Telerik,

I've a trouble..

I set Maximum to 999999 and IsInteger = true which means value can't be more than 999,999 or 6 digits. But when I key in 999999 in my control it round-up and show 1,000,000 ( another i.e. key in 999994 , it round down to 999990 )
How to turn off automatic round function ?

this is my XAML
<telerik:GridViewDataColumn ValidatesOnDataErrors="None" Width="250" DataMemberBinding="{Binding MinAmt}" Header="Minimum Amount" 
                        HeaderTextAlignment="Center" TextAlignment="Right">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding MinAmt, StringFormat='0,0'}" TextAlignment="Right" 
                    x:Name
="MinAmtTextBlock" Loaded="MinAmtTextBlock_Loaded" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
                  <telerik:RadNumericUpDown  Maximum="999999" UpdateValueEvent="PropertyChanged" 
                                            ShowButtons="False" PreviewKeyDown="MinAmt_PreviewKeyDown"
        Value="{Binding Amount, Mode=TwoWay, UpdateSourceTrigger=Explicit}" 
                                            x:Name="MinAmt" Loaded="MinAmt_Loaded" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>

please give me some advice
Regard,
SweNz
Pana
Telerik team
 answered on 19 Sep 2011
3 answers
148 views
First something about RadGridView:
When I move the mouse over a RadGridView and I'm using my MouseWheel to scroll this works at once.
It works even when I had focused an other control, let's say a TextBox.

But...
Doing the same with a RadMap, nothing happens. I have to click on the map først, and then I can use the MouseWheel to scroll.
Is there a way to trigger the scrolling without clicking first?
Andrey
Telerik team
 answered on 19 Sep 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?