Telerik Forums
UI for WPF Forum
3 answers
210 views
Hello,
I try to used RadScheduleView, but there is a problem...
My XAML
<Controls1:RadScheduleView 
Grid.Row="1" 
CurrentDate ="{Binding Path=. , Mode=TwoWay,
         Converter={StaticResource crossRegistersToDayStartEndTime},
         ConverterParameter={x:Static Converters:DateTimeDirection.None}}"
AppointmentsSource ="{Binding Path=., Converter={StaticResource crossRegistersToAppointmentConverter}}">
            <Controls1:RadScheduleView.ActiveViewDefinition >
            <Controls1:TimelineViewDefinition                                            
                                             Orientation="Horizontal"
                                              DayStartTime="04:00"
                                              DayEndTime="16:00"
                                              VisibleDays ="2" />               
            </Controls1:RadScheduleView.ActiveViewDefinition>
            <Controls1:RadScheduleView.ResourceTypesSource>
                <Controls1:ResourceTypeCollection>
                    <Controls1:ResourceType Name="RcpCalculation">
                        <Controls1:Resource ResourceName="RcpTimeTable" />
                        <Controls1:Resource ResourceName="RcpCrossRegister" />
                    </Controls1:ResourceType>
                </Controls1:ResourceTypeCollection>
            </Controls1:RadScheduleView.ResourceTypesSource>
        </Controls1:RadScheduleView>

and it shows appointments correctly.

Problem occures when I change VisibleDays = "1"
Although all appointments are located in the one day (the first one), none of them are shown...

I use 01535RadControls_for_WPF40_2011_2_0912_TRIAL_hotfix.

What is wrong?

thanks in advance
Robert
Valeri Hristov
Telerik team
 answered on 21 Sep 2011
2 answers
198 views
Hello

I have issue with tool window's. Can any body say how to get current active tool window? I need implement same functionality "Close" like in Visual Studio.

this._contentDocking.ActivePane

Sometimes it's null and sometimes it's wrong. 

Thank's in advance!

Miroslav Nedyalkov
Telerik team
 answered on 21 Sep 2011
2 answers
139 views
Hi

I'm fairly new to WPF. I'm trying to display a slider control between buttons on a tool bar.

I want my XAML to look something like this:

<telerik:RadToolBar>
                <telerik:RadButton ToolTip="This is a button to the the left of the slider">
                    <Image Source="/Icons/left_icon.png" />
                </telerik:RadButton>
                <telerik:RadSlider Value="5" Minimum="0" SmallChange="1" Maximum="100" />
                <telerik:RadButton ToolTip="This is a button to the right of the slider">
                    <Image Source="/Icons/right_icon.png"/>
                </telerik:RadButton>
            </telerik:RadToolBar>

This doesn't show me the slider at all. Does it need some special container or a special width set to it?
Kareema
Top achievements
Rank 2
 answered on 21 Sep 2011
1 answer
97 views

Hi all, it's a long story, I have to show data in a grid, I were forced to use a datatable to represent records, luckily the radgridview works like a charm with datatables.

When i add a record to the datatable I call Rebind to let the grid stay in sync. And that worked fine for months.

Now the customer wants that when a record is inserted the grid scroll to show the latest record inserted.

So i tried the scrollintoview with no success. Then i used the BringIndexIntoView that worked.

But after the call to BringIndexIntoView the following call to Rebind generate a NullReferenceException.

Also note that if I try to catch the exception and show a standard windows messagebox the messagebox too raise an exception. Seems like the call to BringIndexIntoView messed up the program.

To reproduce the error i created a project if that can help. Just copy into a new VS2010 WPF project named WpfApplication1 using telerik 2010 Q1 SP2 and framework 4.0.

When running click on reset datasource then click twice on add record.

//MainWindow.xaml.cs
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;
using System.Data;
 
namespace WpfApplication1
{
    public partial class MainWindow : Window
    {
        SampleData sd;
        public MainWindow() {           
            InitializeComponent();
        }
        private void button1_Click(object sender, RoutedEventArgs e) {
            BindToNewDS();
        }
        private void BindToNewDS()  {
            sd = new SampleData(50);
            radGridView1.ItemsSource = sd.TheTable;
        }
        private void button2_Click(object sender, RoutedEventArgs e)  {
            int idx = sd.CreateSampleRecord();
            radGridView1.Rebind();
 
            DataRow dr = (radGridView1.ItemsSource as DataTable).Rows
                    .Find(new Object[] { idx });
 
            if (radGridView1.Items.Contains(dr))
            {               
                int iof = radGridView1.Items.IndexOf(dr);
                radGridView1.BringIndexIntoView(iof);
            }
        }
    }
}

MainWindow.xaml

<Window x:Class="WpfApplication1.MainWindow"
        Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="45"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <telerik:RadGridView  ShowInsertRow="False" CanUserInsertRows="False" RowHeight="22"
            SelectionMode="Extended" Grid.Row="1" Name="radGridView1"
            IsReadOnly="True">
            <telerik:RadGridView.Columns>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <Button Content="Reset datasource" Height="29" HorizontalAlignment="Left" Margin="16,11,0,0" Name="button1" VerticalAlignment="Top" Width="94" Click="button1_Click" />
        <Button Content="Add record and scroll to" Height="30" HorizontalAlignment="Left" Margin="132,10,0,0" Name="button2" VerticalAlignment="Top" Width="144" Click="button2_Click" />
    </Grid>
</Window>

 

//SampleData.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
 
namespace WpfApplication1
{
    class SampleData
    {
        //define fixed columns
        private DataColumn[] fixedColumns = new DataColumn[] {
                new DataColumn("Equipment", typeof(string)),               
                new DataColumn("Place Of Receipt", typeof(string)),
                new DataColumn("Port Of Load", typeof(string)),
                new DataColumn("Port Of Discharge", typeof(string)),
                new DataColumn("Delivery Place", typeof(string))             
            };
        //define variable columns, only a random subset of these columns will be added to resulting table
        private DataColumn[] varColumns = new DataColumn[] {
                new DataColumn("Freight", typeof(decimal)),               
                new DataColumn("Bunker", typeof(decimal)),               
                new DataColumn("Peak season", typeof(decimal)),               
                new DataColumn("Pickup costs", typeof(decimal)),               
                new DataColumn("Delivery costs", typeof(decimal))               
            };
        private string[][] sampleData = new string[][] {
                new string[] {"Equipment", "20 box", "20 o.t.", "40 box", "40 o.t.", "40 h.c."},
                new string[] {"Place Of Receipt", "Lyon", "Tolouse", "Torino", "Milano", "Verona", "Madrid"},
                new string[] {"Port Of Load", "Marseille", "Genova", "La Spezia", "Barcelona", "Napoli"},
                new string[] {"Port Of Discharge", "New York", "Montreal ramp", "Norfolk", "Miami", "Savannah"},
                new string[] {"Delivery Place", "Atlanta", "Jersey City, NJ", "Edison, NJ", "Oaks, PA", "Taftsville, CT"},               
            };
        private Random randGenerator = new Random();
        private int LastID = 0;
 
        public SampleData(int initialRecordCount)
        {
            GenerateTableDefinition();
            CreateSampleRecord();
            for (int i = 1; i < initialRecordCount; ++i)
                CreateSampleRecord();
        }
 
        public int CreateSampleRecord()
        {
            var row = m_TheTable.NewRow();
            LastID += randGenerator.Next(99)+1;
            row["ID"] = LastID;
            m_TheTable.Rows.Add(row);
 
            foreach (DataColumn dc in m_TheTable.Columns)
            {
                string[] sample;
                int randIdx;
                sample = sampleData.FirstOrDefault(a => a[0].Equals(dc.ColumnName));
                if (sample != null)
                {
                    randIdx = randGenerator.Next(sample.Count() - 2);
                    row[dc] = sample[randIdx + 1];
                }
                if (dc.DataType == typeof(decimal))
                {
                    row[dc] = (decimal)(randGenerator.Next(60) * 50);
                }
            }
            return LastID;
        }
        private void GenerateTableDefinition()
        {
            //creating table
            DataTable dt = new DataTable("FreightRates");
            //creating primary key
            dt.Columns.Add(new DataColumn("ID", typeof(int)));
 
            //adding fixed columns to table
            foreach (DataColumn dc in fixedColumns)
            {
                dt.Columns.Add(dc);
            }
 
            //selecting randomly a number of variable columns to be added to the table
            List<DataColumn> varColumnList = varColumns.ToList();
 
            int numberOfVariableColumns = randGenerator.Next(varColumnList.Count() - 1);
 
            for (int i = 0; i < numberOfVariableColumns; ++i)
            {
                int randomlySelectedColumn = randGenerator.Next(varColumnList.Count() - 1);
                dt.Columns.Add(varColumnList[i]);
                varColumnList.RemoveAt(i);
            }
            //expliciting primary key
            dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };
            TheTable = dt;
        }
 
        private DataTable m_TheTable;
        public DataTable TheTable
        {
            get { return this.m_TheTable; }
            private set
            {
                if (value != this.m_TheTable)
                {
                    this.m_TheTable = value;                  
                }
            }
        }
    }
}



Vlad
Telerik team
 answered on 21 Sep 2011
3 answers
176 views
Hi,

I have a static set of images within the transition control. Right now I can display 10 images per per page. I want to ask how can I create another set of 10 images that will be shown on the next page. Data template only allows me one set of images. 

Also, how can I have two custom images (arrow left and arrow right) to trigger "Next page" and "Previous page"? My current code is shown below:


<telerik:RadTransitionControl x:Name="TransitionControl" SnapsToDevicePixels="True" Margin="130,124,100,184">
            <telerik:RadTransitionControl.ContentTemplate>
                <DataTemplate>
                    <StackPanel>
                        <WrapPanel Orientation="Horizontal">
                            <WrapPanel.Resources>
                                <Style TargetType="{x:Type Image}">
                                    <Setter Property="Margin" Value="10,10" />
                                </Style>
                            </WrapPanel.Resources>
                            <Image Height="250" Width="180" DataContext="{Binding}" Source="/Kintrol;component/Images/300.jpg" />
                            <Image Source="Images/1.jpg" Height="250" Width="180" />
                            <Image Source="Images/2.jpg" Height="250" Width="180" />
                            <Image Source="Images/3.jpg" Height="250" Width="180" />
                            <Image Source="Images/4.jpg" Height="250" Width="180" />
                            <Image Source="Images/5.jpg" Height="250" Width="180" />
                            <Image Source="Images/6.jpg" Height="250" Width="180" />
                            <Image Source="Images/7.jpg" Height="250" Width="180" />
                            <Image Source="Images/8.jpg" Height="250" Width="180" />
                            <Image Source="Images/9.jpg" Height="250" Width="180" />
                        </WrapPanel>
                    </StackPanel>
                </DataTemplate>
            </telerik:RadTransitionControl.ContentTemplate>
            <telerik:RadTransitionControl.Transition>
                <telerik:SlideAndZoomTransition />
            </telerik:RadTransitionControl.Transition>
        </telerik:RadTransitionControl>
        <Image Source="Images/next.png" Margin="1134,332,12,359"  />
        <Image Source="Images/previous.png" Margin="12,262,1134,334" />
Miroslav Nedyalkov
Telerik team
 answered on 21 Sep 2011
2 answers
156 views
I have a RadGridView with 30000 items, few columns need conditional formatting. One is simple - all above 10.0 red, other are more complex - based on few properties and ranges. Should i use value converters or StyleRule? Which one is faster? Is it depend based on complexity or amount of conditions?
Krzysztof
Top achievements
Rank 1
 answered on 21 Sep 2011
1 answer
302 views
Hi!
A RadRibbonButton has the property RibbonBar:KeyTipService.AccessText.
If you for some reason want to Hide/Collapse the button the AccessText will still be visible in the application!
A ribbongroup with two buttons where one of them is collapsed/hidden will display two AccessText values
(one over the button that is visible and one one over the ribbongroup border)

This means that a user can open up windows/forms or perform actions that he should not be allowed to acccess!

Please advice on how to avoid this. Do I have to remove the property on every button that has Visibility=Collpased or Hidden,
or is there another way to solve this?

Petar Mladenov
Telerik team
 answered on 20 Sep 2011
4 answers
156 views

Hi,

 

I have a RadGridview that contains a number of data columns and a  custom column , which is basically a GridViewDataColumn user control that consists of a textbox and a button.  If the user is editing a cell in one of the data column and then immediately clicks on the textbox in the custom column, the pervious cell is still on edit mode and the binding is not committed ( as the way if the user tabs always from the cell).  How can I have the other cell updating the  target binding if the user click on the texts box within the custom control.

 

Cheers

Perlom
Top achievements
Rank 1
 answered on 20 Sep 2011
3 answers
141 views
Hi

[reproduce and phenomenon]
Bind the RadSlider's SelectionStart/SelectionEnd to Application's DependencyProperty.
When Slider's Thumb is dragged out of the control, values which exceed Minimum/Maximum
Property are substituted into the Property.

This problem did not occur in the Q1 2011.
 
If there is any way to avoid the above phenomenon, please let me know.

  • RadControl for WPF (Version: 2011.2.712.40)
  • OS:Windows7 Ultimate 64 bit
  • VisualStudio 2010 SP1

[VS Project]
RadSliderTest Project

[XAML]
<Window
    x:Class="RadSliderTest.MainWindow"
    Title="RadSlider TEST" Width="640" Height="320"
    Background="#FF393838" TextBlock.Foreground="White" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
        </Grid.RowDefinitions>
         
        <TextBlock Margin="8,8,8,2" Text="RadSlider(SelectionRangeEnable, Minimun:0.0, Maximum1.0) " VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <telerik:RadSlider x:Name="radSlider" Margin="8" VerticalAlignment="Center"
            SelectionStart="{Binding RangeBegin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
            SelectionEnd="{Binding RangeEnd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
            IsSelectionRangeEnabled="True" Grid.Row="1"/>
 
        <TextBlock Margin="8,8,8,2" Grid.Row="2" Text="MainWindow DependencyProperty Binding" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <Grid Margin="8" Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
 
            <TextBlock Margin="8" Text="RangeBegin" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            <TextBlock Margin="8" Grid.Row="1" TextWrapping="Wrap"
                Text="{Binding RangeBegin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
                VerticalAlignment="Center" Grid.Column="1" Foreground="Black" Background="White" />
            <TextBlock Margin="8" Text="RangeEnd" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right" />
            <TextBlock Margin="8" Grid.Row="1" TextWrapping="Wrap"
                Text="{Binding RangeEnd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
                VerticalAlignment="Center" Grid.Column="3" Foreground="Black" Background="White" />
        </Grid>
 
        <TextBlock Margin="8,8,8,2" Grid.Row="4" Text="ControlBinding" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <Grid Margin="8" Grid.Row="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Margin="8" Text="SelectionStart" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            <TextBlock Margin="8"
                Text="{Binding SelectionStart, ElementName=radSlider}"
                VerticalAlignment="Center" Grid.Column="1" Background="White" Foreground="Black" />
            <TextBlock Margin="8" Text="SelectionEnd" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right"/>
            <TextBlock Margin="8"
                Text="{Binding SelectionEnd, ElementName=radSlider}"
                VerticalAlignment="Center" Grid.Column="3" Background="White" Foreground="Black" />
        </Grid>
    </Grid>
</Window>

[CS]
using System.Windows;
 
namespace RadSliderTest
{
    public partial class MainWindow : Window
    {
        #region [RangeBegin] DependencyProperty
        public double RangeBegin
        {
            get { return (double)GetValue(RangeBeginProperty); }
            set { SetValue(RangeBeginProperty, value); }
        }
        public static readonly DependencyProperty RangeBeginProperty =
            DependencyProperty.Register("RangeBegin", typeof(double), typeof(MainWindow), new PropertyMetadata(0.0));
        #endregion
 
        #region [RangeEnd] DependencyProperty
        public double RangeEnd
        {
            get { return (double)GetValue(RangeEndProperty); }
            set { SetValue(RangeEndProperty, value); }
        }
        public static readonly DependencyProperty RangeEndProperty =
            DependencyProperty.Register("RangeEnd", typeof(double), typeof(MainWindow), new PropertyMetadata(1.0));
        #endregion
 
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}
Takashi Nimura
Top achievements
Rank 1
 answered on 20 Sep 2011
3 answers
211 views
Hello,

I have problem with RadColumnSparkline with RadTimebar.
It seems like the bars don't placed in the correct location.

I've looked in the thread "Data is not display in correct time location" and there's an example there for RadLinearSparkline with RadTimebar, I tried that example and the result was correct, but when I had changed the control from RadLinearSparkline to RadColumnSparkline, I saw some shifting in the bars.

Do I need to do some extra modifications for using RadColumnSparkline?

(I tried with Telerik RadControls for WPF 2011 Q2 2011.2.0712 & 2011.2.0823)


Thanks
Missing User
 answered on 20 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?