Telerik Forums
UI for WPF Forum
1 answer
168 views
Hi,

I am using Self reference grid, in that

1. How to hide (Isvisible = false) for some columns in the child grid
2. How to make the column width of parent and child as same.

Thanks,
Ramasamy
Maya
Telerik team
 answered on 28 Sep 2011
2 answers
114 views
Hello,

I have a radchart that I wish to add x series to dynamically depending on what you check off in a checkbox list.

I have a RadChart declared like this:
<telerik:RadChart x:Name="radChart" telerik:StyleManager.Theme="Metro" SeriesMappings="{Binding ChartSeriesMapping}" >
            </telerik:RadChart>

My ChartSeriesMapping is declaredl like this:
private SeriesMappingCollection _chartSeriesMapping;
public SeriesMappingCollection ChartSeriesMapping
{
    get
    {
        return _chartSeriesMapping;
    }
    set
    {
        if (_chartSeriesMapping != value)
        {
            _chartSeriesMapping = value;
            this.OnPropertyChanged("ChartSeriesMapping");
        }
    }
}

I'm adding series like this:
SeriesMapping salesAmountMapping = new SeriesMapping();
salesAmountMapping.LegendLabel = p.StoreName;
 
salesAmountMapping.ItemsSource = report.ChartData;
salesAmountMapping.SeriesDefinition = new BarSeriesDefinition();
 
salesAmountMapping.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));
salesAmountMapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
 
report.ChartSeriesMapping.Add(salesAmountMapping);
Where ChartData is containing XValue and YValue public properties.

But the charts is always empty when I'm adding new series... How is this supposed to work? Also, how come legend Label is always set to Series 0, Series 1, etc?

Thanks in advance.
Yavor
Telerik team
 answered on 28 Sep 2011
1 answer
124 views
I use row detail in radgridview but encounter some tricky problem. Please use the code below, and click the + to show the detail row one by one, at least open one screen, then scroll the vertical scrollbar , or use mouse wheel, then if you are lucky, the sceen will tremble, unless you scroll again. To reproduce it maybe need some fortume, but i could reproduce it everytime. I am not sure if I make myself clear. How to solve this problem? Thanks.

<Window x:Class="WpfApplication1.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" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
        mc:Ignorable="d"
        Title="MainWindow" d:DesignHeight="1024" d:DesignWidth="1280" MinHeight="700" MaxHeight="1024" MaxWidth="1280" SnapsToDevicePixels="True">
    <Grid>       
        <telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False" IsReadOnly="True">            
            <telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="" Width="600"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding UserID}" TextAlignment="Center"  Header="CUSIP" Width="400" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ClientID}" TextAlignment="Center" Header="PRCMnum" Width="400" />
            </telerik:RadGridView.Columns>
 
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>                    
                    <Grid x:Name="rowDetails">
                        <StackPanel Orientation="Horizontal" Margin="200,5,0,5">
                            <Label Content="ID:" Margin="0,0,5,0"/>
                            <TextBox Text="{Binding ID}"  Width="80" />                                    
                            <Label Content="UserID:" Margin="10,0,5,0"/>
                            <TextBox Text="{Binding UserID}"  Width="80" />
                            <Label Content="ClientID:" Margin="10,0,5,0"/>
                            <TextBox Text="{Binding ClientID}" Width="80" />                                    
                        </StackPanel>                        
                    </Grid>                       
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>
        </telerik:RadGridView>        
    </Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
using System.Collections.ObjectModel;
 
namespace WpfApplication1
{   
    public partial class MainWindow : Window
    {
        
        public MainWindow()
        {
            InitializeComponent();          
           
            this.radGridView.ItemsSource = new ObservableCollection<AgencySpecPool>(GetSpecPoolInfoHierarchy());    
        }
 
        List<AgencySpecPool> GetSpecPoolInfoHierarchy()
        {
            List<AgencySpecPool> list = new List<AgencySpecPool>();
            for (int i = 0; i < 1000; i++)
            {
                int seed = (int)DateTime.Now.Ticks + i;
                Random rand = new Random(seed);
                list.Add(new AgencySpecPool(rand.Next(), rand.Next(), rand.Next()));
            }
            return list;
        }
    }
 
    public class AgencySpecPool
    {        
        public int ID {get;set;}
        public int UserID { getset; }
        public int ClientID { getset; }
        public AgencySpecPool(int id, int uid, int cid)
        {
            ID = id;
            UserID = uid;
            ClientID = cid;
        }
    }
}
Yordanka
Telerik team
 answered on 28 Sep 2011
1 answer
129 views
Hi,

I have a RadTabControl on my WPF form with multiple tabs (9). If I click on the "WindowState=Normal" button to shrink my form, some tabs become not visible due to the display space but the scroll buttons of my RadTabControl doesn't appear. I have to resize my form manually to get the RadTablControl scroll buttons visible.

I use VS2008 and Telerik v.2011.2.712.35

Thank's
Petar Mladenov
Telerik team
 answered on 28 Sep 2011
0 answers
96 views
Hi Support

I have two ItemPropertDefinition Which binded to two different combo box, I want to filter ItemSource of second one according to Selected Item of first Combo. is it possible  in DataFilter? how can I implement it?

Thanks in advance
Mehri
Mehri
Top achievements
Rank 1
 asked on 28 Sep 2011
1 answer
72 views
Hi,

I have a table like the below

ID   Name          Parent ID
1    Benefits        NULL
2    Enrolment     NULL
3    Health             1
4    Employee       1
5    Initial               2

and i need the output like

-Benefits
      - Health
      - Employee
- Enrolment
      - Initial

Now I am getting the hierachy correctly, but instead of showing only the parents my grid shows all the 5 rows. Any idea please.

Thanks,
Ramasamy
Ramasamy
Top achievements
Rank 1
 answered on 28 Sep 2011
1 answer
155 views
Hi,

I am using the CommonHeaders stuff for the multiple column headers. 

 

<i:Interaction.Behaviors>
<local:ColumnGroupsBehavior>
<local:ColumnGroupsBehavior.CommonHeaders>
<local1:CommonHeader StartColumnIndex="0" Caption="" ColumnSpan="3" />
<
/local:ColumnGroupsBehavior.CommonHeaders>
</local:ColumnGroupsBehavior>
</i:Interaction.Behaviors>

My common headers are dynamic and need set in code behind. How it can be achieved at runtime.

Thanks,
Ramasamy

Ramasamy
Top achievements
Rank 1
 answered on 28 Sep 2011
3 answers
155 views
Hi,

I am new to WPF and Telerik controls.  I have been through the online documentation, the RadControls Demos that install with the controls, various forums and reference material including the telerik forums.  I have tried several pieces of code and I can't get the TwoWay binding to work.  I can achieve what I want to do with CodeBehind but that is sort of defeating the purpose.

So I have a RadGridView that is populated by a dataset.  I do this by the code below. rgvSamples is the RadGridView.  dsMain is a dataset.

rgvSamples.ItemsSource = dsMain.Tables["Samples"];

In XAML I then set the various DataContext and Bindings as seen below.

<StackPanel Height="357" HorizontalAlignment="Left" Margin="736,25,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="211">
            <Grid Height="51" Name="grid1" Width="212" DataContext="{Binding ElementName=rgvSamples, Path=SelectedItem}">
                <TextBox Height="23" HorizontalAlignment="Left" Margin="55,6,0,0" x:Name="textBox1" VerticalAlignment="Top" Width="143" Text="{Binding Path=CodeStr, Mode=TwoWay}"/>
                <Label Content="Label" Height="23" HorizontalAlignment="Left" Margin="6,6,0,0" Name="label1" VerticalAlignment="Top" Width="43" />
            </Grid>
        </StackPanel>

The above code above does not actually work even though it is almost identical to some of the solutions posted on this forum.  I also have a standalone Textbox as seen in the code below which also does not work.

<TextBox Height="36" HorizontalAlignment="Left" Margin="580,145,0,0" Name="textBox2" VerticalAlignment="Top" Width="120" Text="{Binding ElementName=rgvSamples, Path=SelectedItem.CodeStr}"/>

Now by making the following changes I get the first value in the GridView to show but that is it.  If I select a different row then the value in the textbox does not change.

rgvSamples.ItemsSource = dsMain.Tables["Samples"];
            stackPanel1.DataContext = rgvSamples.ItemsSource;

<StackPanel Height="357" HorizontalAlignment="Left" Margin="736,25,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="211">
            <Grid Height="51" Name="grid1" Width="212" DataContext="{Binding CurrentItem}">
                <TextBox Height="23" HorizontalAlignment="Left" Margin="55,6,0,0" x:Name="textBox1" VerticalAlignment="Top" Width="143" Text="{Binding CodeStr, Mode=TwoWay}"/>
                <Label Content="Label" Height="23" HorizontalAlignment="Left" Margin="6,6,0,0" Name="label1" VerticalAlignment="Top" Width="43" />
            </Grid>
        </StackPanel>

So I have been going through forum posts etc for about 3 days now trying to see what i am doing wrong.  can some one please point me in the correct direction.

Thanx
Kind Regards
Richard
Dimitrina
Telerik team
 answered on 27 Sep 2011
1 answer
150 views
In short I've been unable to modify the style settings for the gridview row reorder example.
The demo example can not locate the style settings. I've been messing around and narrowed it down that this line of code does not expose the gridview namespace because the RowStyle property would state "Cannot resolve path."

Question:
How would I be able to modify the top and bottom lines of the DraggedTemplate?
From:
Line 1: Customer: Bob (Orange background)
Line 2: Drop after Customer: James

To:
Line1: Method 21 (Blue Background)
Line2: Drop after Sequence Run 30


I included this to expose the GridViewRow

xmlns:gd="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"

For x:Key="DraggedRowStyle

<Grid.Resources>
            <Style TargetType="gd:GridViewRow" x:Key="DraggedRowStyle">
                <Setter Property="dragAndDrop:RadDragAndDropManager.AllowDrag" Value="True" />
            </Style>
            <Style TargetType="treeView:TreeViewDragCue" x:Key="CueStyle">
                <Setter Property="DragTooltipVisibility" Value="Collapsed"/>
            </Style>
            <DataTemplate x:Key="DraggedItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Sender}" FontWeight="Bold" />
                    <TextBlock Text=", (" Foreground="Gray" />
                    <TextBlock Text="{Binding Subject}" Foreground="Gray" />
                    <TextBlock Text=")" Foreground="Gray" />
                </StackPanel>
            </DataTemplate>
            <LinearGradientBrush x:Key="DropPossibleBackground" StartPoint="0 0" EndPoint="0 1">
                <GradientStop Offset="0" Color="White" />
                <GradientStop Offset="1" Color="#FFE699" />
            </LinearGradientBrush>
            <DataTemplate x:Key="testTemplate1">
                <Border Width="50" Height="50" Background="Red">
                </Border>
            </DataTemplate>
            <DataTemplate x:Key="testTemplate2">
                <Border Width="50" Height="50" Background="Green">
                </Border>
            </DataTemplate>
        </Grid.Resources>

Here is my gridview

<telerik:RadGridView HorizontalAlignment="Stretch" Name="RadGridView1"
                     VerticalAlignment="Stretch" AutoGenerateColumns="False"
                     CanUserFreezeColumns="False" CanUserReorderColumns="False"
                     ShowColumnHeaders="True" ShowGroupPanel="False" ShowInsertRow="True"
                     DataContext="{Binding Source={StaticResource SequenceCollectionData}}"
                     dragAndDrop:RadDragAndDropManager.AllowDrop="True" RowStyle="{StaticResource DraggedRowStyle}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="Sample Name" UniqueName="gvcSample" IsGroupable="False"
                                    IsReorderable="False" DataMemberBinding="{Binding Path=SampleName}" />
        <telerik:GridViewDataColumn Header="ID" UniqueName="gvcGuidID" IsGroupable="False"
                                    IsReorderable="False" DataMemberBinding="{Binding Path=GuidID}"
                                    IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

Restating Question: How would I be able to modify the top and bottom lines of the DraggedTemplate?
From:
Line 1: Customer: Bob
Line 2: Drop after Customer: James

To:
Line1: Method 21
Line2: Drop after Sequence Run 30

Thank you,
Dimitrina
Telerik team
 answered on 27 Sep 2011
1 answer
183 views
I have an issue with detecting floating panes being closed.

On our dock manager we use both PaneStateChange and ActivePaneChanged to try to track which panes in the dock mgr are visible and give the user visual options to show and hide panes.

When a pane is floating and they click the close button, sometimes the ActivePaneChanged event will fire and sometimes it doesn't leaving our pane visual switchboard incorrect.

What would be the sure way to detect floating panes being closed?

Preferrably a trigger from the dock manager because some of our panes are dynamically generated at runtime and I would rather not have triggers attached to every possible pane for this purpose.
Konstantina
Telerik team
 answered on 27 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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?