Telerik Forums
UI for WPF Forum
2 answers
131 views
Hi there,

I am trying to create style for RadDateTimePicker control, i am able to create the RadCalender style which is a part of it. but i am unable to create the style for Radclock.

Please look at attached screenshot which i have done some styling, and if you can notice there i have marked three areas on clock, which needs to style, i am not able to find them in expression blend.

Can you please tell me how i can do the styling for those marked part.
Let me know if you need any more details.

Thanks in advance,
Srinivas. 
Ravi
Top achievements
Rank 1
 answered on 01 Aug 2012
3 answers
95 views
Hi Telerik Team,

I am getting a strange exception, when have a grouped gridview and refresh the datasource. 
I delete in a background operation some rows and go to the database to refresh the datasource, which is binded to the grid. I get a "Specified argument was out of the range of valid values. Parameter name: index" - Exception on the setter of the datasource. 

I similar problem was discriped in this thread, but I couldn't solve it for WPF.
http://www.telerik.com/community/forums/aspnet-ajax/grid/expanded-hierarchical-grid-hit-error-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-itemhierarchicalindex.aspx 

Best,
Thomas
Dimitrina
Telerik team
 answered on 01 Aug 2012
5 answers
183 views
I upgraded from Q1 2012 to Q2 2012 using the Telerik Control Panel. The upgraded reported no errors. My project seems to be working fine. However, when I am trying to start the Demo application, I and getting a "Stop working" error. Prior to the update, the demo app used to work fine.

This is what I found in the machine's Event Log:

Application: WPF Demos.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException
Stack:
   at System.IO.__Error.WinIOError(Int32, System.String)
   at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean)
   at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions)
   at System.IO.StreamWriter.CreateFile(System.String, Boolean)
   at System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32)
   at System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding)
   at System.IO.File.InternalAppendAllText(System.String, System.String, System.Text.Encoding)

Andrey
Telerik team
 answered on 01 Aug 2012
2 answers
123 views
According to this article, we can use different token in chartview to format our data.
I want to define a new token, for example a new token named such as #dateindays that
converts DateTime data to day number in current year. Is it possible to do so, and if yes, how?
Mohammad Amin Solhizadeh
Top achievements
Rank 1
 answered on 01 Aug 2012
2 answers
322 views
Hi there,

I'm using WPF and Telerik's WPF controls for the first time and I'm trying to figure out how I can change the style of the button. Right now I'm using radio buttons to switch between different sections of an application, but they still look like regular buttons. I want to remove the background and have an icon appear above the text in the middle instead.
It should also have a specific hover and active state.

Thanks,
Jacques
Jacques
Top achievements
Rank 2
 answered on 01 Aug 2012
8 answers
1.1K+ views
Hello,

I have been struggling with the GridView to get it to display my data as my ObservableCollection changes. It appears that the grid is only updating when the user moves a scroll bar. How can I make my grid update as my collection does, without messing up my scroll position. I attempted using the Rebind() method to get it to refresh, but the scroll bar resetting is unacceptable.

Here is a little information about my setup.

I am using the WPF Rad Controls Q2 2012 edition.

My Observable collection is a two dimensional collection that looks like this:

private ObservableCollection<ObservableCollection<LogField>> _RowData;
public ObservableCollection<ObservableCollection<LogField>> RowData
{
    get { return _RowData; }
    set
    {
        if (value != _RowData)
        {
            _RowData = value;
            onPropertyChanged(this, "RowData");
        }
    }
}

Here is what the LogField Class looks like:

public class LogField : INotifyPropertyChanged
    {
        private byte _HighlighFlag;
        public byte HighlightFlag
        {
            get { return _HighlighFlag; }
            set
            {
                if (value != _HighlighFlag)
                {
                    _HighlighFlag = value;
                    onPropertyChanged(this, "HighlightFlag");
                }
            }
        }
 
        private string _Value;
        public string Value
        {
            get { return _Value; }
            set
            {
                if (value != _Value)
                {
                    _Value = value;
                    onPropertyChanged(this, "Value");
                }
            }
        }
 
        private string _DisplayUnits;
        public string DisplayUnits
        {
            get { return _DisplayUnits; }
            set
            {
                if (value != _DisplayUnits)
                {
                    _DisplayUnits = value;
                    onPropertyChanged(this, "DisplayUnits");
                }
            }
        }
 
        private string _BaseUnits;
        public string BaseUnits
        {
            get { return _BaseUnits; }
            set
            {
                if (value != _BaseUnits)
                {
                    _BaseUnits = value;
                    onPropertyChanged(this, "BaseUnits");
                }
            }
        }
 
        private byte _FieldType;
        public byte FieldType
        {
            get { return _FieldType; }
            set
            {
                if (value != _FieldType)
                {
                    _FieldType = value;
                    onPropertyChanged(this, "FieldType");
                }
            }
        }
 
        private string _FieldFormat;
        public string FieldFormat
        {
            get { return _FieldFormat; }
            set
            {
                if (value != _FieldFormat)
                {
                    _FieldFormat = value;
                    onPropertyChanged(this, "FieldFormat");
                }
            }
        }
 
        private int _SelectOffset;
        public int SelectOffset
        {
            get { return _SelectOffset; }
            set
            {
                if (value != _SelectOffset)
                {
                    _SelectOffset = value;
                    onPropertyChanged(this, "SelectOffset");
                }
            }
        }
 
        private int _UnitNumber;
        public int UnitNumber
        {
            get { return _UnitNumber; }
            set
            {
                if (value != _UnitNumber)
                {
                    _UnitNumber = value;
                    onPropertyChanged(this, "UnitNumber");
                }
            }
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
        private void onPropertyChanged(object sender, string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(sender, new PropertyChangedEventArgs(propertyName));
            }
        }
    }


I am setting up the columns manually and here is what the column setup and binding look like.

// Initialize the radGridView with the propper settings for a log screen.
int columnIndex = 0;
thisMMGridView.Height = 280;
LogScreen logScreen = (LogScreen)thisMMGridView.CurrentScreen;
thisMMGridView.radGridView.AutoGenerateColumns = false;
thisMMGridView.radGridView.Columns.Clear();
 
// Build the columns based on the headerStrings
foreach (string headerString in logScreen.ColumnHeaderStrings)
{
    GridViewDataColumn column = new GridViewDataColumn();
 
    // Create the column header
    TextBlock headerText = new TextBlock();
    headerText.Text = headerString;
    headerText.TextWrapping = TextWrapping.Wrap;
    headerText.TextAlignment = TextAlignment.Left;
    headerText.Padding = new Thickness(1, 0, 2, 0);
    column.HeaderCellStyle = thisMMGridView.TryFindResource("AlarmGridViewHeaderCellStyle") as Style;
    column.Header = headerText;
    column.UniqueName = headerString;
    thisMMGridView.radGridView.Columns.Add(column);
    // Bind the column to it's data
    column.DataMemberBinding = new Binding("["+ columnIndex.ToString() +"].Value");
     
    // Bump the column index that is used for the columnBind
    columnIndex++;
}
 
// Freeze the time & date columns so they are always visible
if (thisMMGridView.radGridView.Columns[1].UniqueName == "DATE")
{
    thisMMGridView.radGridView.FrozenColumnCount = 2;
}
else
{
    thisMMGridView.radGridView.FrozenColumnCount = 1;
}
 
// Set the ItemsSource property of the grid to the data collection.
thisMMGridView.radGridView.ItemsSource = thisMMGridView.Unit.LogData.RowData;


I have wasted a lot of time on this issue and I am just looking for a solution, so I can move forward. 

Hope to hear something soon,
Brian
Dimitrina
Telerik team
 answered on 01 Aug 2012
1 answer
180 views
Hi,

I am trying to use QueryableDataServiceCollectionView in my Prism based application.My view model is working fine when binding to DataServiceCollection or DataServiceQuery ,but now I want to gain more control over paging,filtering,sorting,and saving data,so I switched to QueryableDataServiceCollectionView.I changed my view model binding property "DataItems" from DataServiceCollection<T> to  QueryableDataServiceCollectionView<T> and now I see the whole data records returned though the pagesize on my QueryableDataServiceCollectionView and on my DataPager is 20.

The grid display 41 records in page 1 and 3 paging buttons [1 2 3].The paging becomes normal (20 records per page) once I click on page1, page 2, or page 3.I checked fiddler and found that the data service query for the first loading lacks the '$top=20' parameter

view.ViewModel.DataItem = new Telerik.Windows.Data.QueryableDataServiceCollectionView<User>(db, db.Users){  AutoLoad = true,PageSize=20};


<telerik:RadGridView    ItemsSource="{Binding PagedSource, ElementName=DataPager1}"  >

<telerik:RadDataPager  Name="DataPager1" Source="{Binding DataItem}"   PageSize="20" DisplayMode="Numeric">


Environment:
VS 2010
.NET 4 + WCF
EF 4
Telerik WPF  2012_2_0725 Trial Version


Thanks in advance
DMC Helpdesk
Top achievements
Rank 1
 answered on 31 Jul 2012
1 answer
122 views
I've tried to do this with Expression Blend and I've had no luck.

I have a form in my WPF application which contains a RadGridView.  I've defined Group Aggregates for the grid:

<telerik:RadGridView AlternationCount="1"
                     AutoExpandGroups="False"
                     AutoGenerateColumns="False"
                     CanUserDeleteRows="False"
                     CanUserFreezeColumns="False"
                     CanUserInsertRows="False"
                     CanUserResizeColumns="True"
                     CanUserSortColumns="True"
                     DataLoadMode="Synchronous"
                     EnableColumnVirtualization="True"
                     EnableRowVirtualization="True"
                     FontSize="16"
                     FontWeight="Bold"
                     Grid.Column="0"
                     Grid.Row="0"
                     IsReadOnly="True"
                     Name="HotListGrid"
                     ScrollViewer.CanContentScroll="True"
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     SelectionChanged="HotListGrid_SelectionChanged"
                     SelectionUnit="FullRow"
                     ShowColumnFooters="True"
                     ShowGroupPanel="False"
                     ToolTip="Hot Lists">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn  DataMemberBinding="{Binding Name      , Mode=OneWay}"
                                     Header="Hot List"
                                     Width="323">
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:CountFunction Caption="Count: " ResultFormatString="{}{0:n0}" />
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn  DataMemberBinding="{Binding ListType  , Mode=OneWay}"
                                     Header="List Type"
                                     Width="Auto" />
        <telerik:GridViewDataColumn  DataMemberBinding="{Binding LastUpdate, Mode=OneWay, Converter={StaticResource DateConverter}}"
                                     Header="Last Update"
                                     Width="200" />
        <telerik:GridViewImageColumn DataMemberBinding="{Binding Status    , Mode=OneWay, Converter={StaticResource DeviceStatuses}}"
                                     Header="Status"
                                     ImageStretch="None"
                                     Width="95" />
        <telerik:GridViewDataColumn  Header="Entries"
                                     TextAlignment="Right"
                                     Width="135">
            <telerik:GridViewDataColumn.DataMemberBinding>
                <Binding Path="EntryCount"
                         Mode="OneWay"
                         Converter="{StaticResource LongConverter}"
                         ConverterParameter="#,##0" />
            </telerik:GridViewDataColumn.DataMemberBinding>
            <telerik:GridViewDataColumn.AggregateFunctions>
                <telerik:SumFunction ResultFormatString="{}{0:n0}" />
            </telerik:GridViewDataColumn.AggregateFunctions>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

My application runs in police cars and has a "night mode" which changes the color pallette.  The problem is that the gradient brush used to draw the background of the Group Footer Row is not going away, so I have a light foreground color on a light background color in night mode that is difficult to read.

I have tried to edit the template for the GridViewGroupFooterRowStyle element in Expression Blend with no luck.  The gradient used in the background is not going away, even with this xaml in the app.xaml:

<Style TargetType="{x:Type telerik:GridViewGroupFooterRow}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:GridViewGroupFooterRow}">
                <Border x:Name="PART_GroupFooterRowBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                    <telerik:SelectiveScrollingGrid>
                        <telerik:SelectiveScrollingGrid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </telerik:SelectiveScrollingGrid.ColumnDefinitions>
                        <Border x:Name="PART_IndicatorPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,0" Grid.Column="0" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" VerticalAlignment="Stretch" Width="25">
                            <Border BorderBrush="White" BorderThickness="1" Background="#FFE4E4E4"/>
                        </Border>
                        <Border x:Name="PART_HierarchyIndent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,0" Grid.Column="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25">
                            <Border.Visibility>
                                <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
                                    <Binding.Converter>
                                        <telerik:BooleanToVisibilityConverter/>
                                    </Binding.Converter>
                                </Binding>
                            </Border.Visibility>
                        </Border>
                        <telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="3" IsTabStop="False" />
                        <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="1" IsTabStop="False" IndentLevel="{TemplateBinding IndentLevel}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                            <telerik:IndentPresenter.ItemTemplate>
                                <DataTemplate>
                                    <telerik:GridViewGroupFooterIndentCell IsTabStop="False">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:GridViewGroupFooterIndentCell>
                                </DataTemplate>
                            </telerik:IndentPresenter.ItemTemplate>
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </telerik:IndentPresenter>
                    </telerik:SelectiveScrollingGrid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="Background" Value="{DynamicResource DataHeaderBackground}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource DataBorder}"/>
    <Setter Property="MinHeight" Value="25"/>
    <Setter Property="BorderThickness" Value="0,0,0,1"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Foreground" Value="{DynamicResource DataHeaderForeground}"/>
</Style>

How do I get rid of that gradient?
Tony
Top achievements
Rank 1
 answered on 31 Jul 2012
4 answers
649 views
I'm using a RadContextMenu on a Canvas.  When I select an item from the menu, I need to know the point in the Canvas in which I was when I opened the menu for placement of another control.  How do I get the top left position of the context menu?

Thanks for your help.
Joel Palmer
Top achievements
Rank 2
 answered on 31 Jul 2012
0 answers
141 views
Hi,

I have an structure like this:

MAinProject with a Custom WindowsClass and a Custom User control

From the main form called "Main" class is instantiated "WindowsClass". This class through a method call generates a window Radwindow type whose content is a custom user control.

Then from the main form made ​​the call to WindowsClass class method as follows:

myClassWindow.AddObjectWindow (objectName, Me)

This command fails me with the implicit object from VB.NET (Me)

The definition of the above method is as follows:

Public Sub AddObjectWindow (ByVal objectName As String, ByVal Owner As System.Windows.Controls.ContentControl)

Error 1 Value of type 'myProject.Main' can not be converted to 'System.Windows.Controls.ContentControl'. C: \ .... \ Projects \ MyProject \ MyProject \ Main.xaml.vb 100 57 myProject

1 - Why is this?
2 - how I can afford it, so the main form (Me) can be passed by value "ByVal" method and this in turn assigned to the Owner property of Radwindow.

I hope I have explained the issue as best as possible ....
Romell
Top achievements
Rank 1
 asked on 31 Jul 2012
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?