Telerik Forums
UI for WPF Forum
5 answers
335 views
Your example "DataForm Integration with RadGridView row-details" looks very nice, but it has a major shortcoming.

It doesn't show how to insert new rows, or how to delete existing rows.

I've been trying to work it out for some hours, now, and am back where I started.

Any ideas?
Maya
Telerik team
 answered on 31 Jan 2012
1 answer
336 views
Hi,
I would like to control the visiblity of a GridViewDataColumn at runtime in a RadGridView.

Thanks in advance.
Vlad
Telerik team
 answered on 31 Jan 2012
0 answers
165 views
It seems like telerik provides several features by default in the base telerik RadGridView Control.
Although, I have achieved some of the customizations I intend to implement. But there are still some which I havent yet been able to implement.
I have attached the snapshots of both the achieved(myradgridview) and the intended(intended1) styles I intend to implement.
I would also like to remove the orangish color of the column header which is activated on mouse hover.
Also, as you would be able to see in the intended1.png snapshot that the color of the selected tuple is bluish and not the orangish provided by default.


Thanks in advance.
Zubair
Top achievements
Rank 1
 asked on 31 Jan 2012
3 answers
413 views
Hi,

I'm having a problem re-templating combo box items on the RadRibbonComboBox. The item template works fine only for items in the drop down, but not for the selected item that shows when the como is closed. I bind the ItemsSource to a collection of custom entities, and was setting the DisplayMemberPath to one of their properties - MemberDisplay - but I now need to do extra formatting on the display so as to change the background colour of certain items based on values in the entity.

As i said, it works for the items in the dropdown, but not for the selection box items. Here is the xaml:

<rad:RadRibbonComboBox
    Width="95"
    Margin="0 5 0 0"
    IsEditable="True"
    IsReadOnly="True"
    ItemsSource="{Binding TimeFilterFromMonitorCombo.Items}"
    SelectedItem="{Binding TimeFilterFromMonitorCombo.SelectedItem}"
    IsSynchronizedWithCurrentItem="True">
    <rad:RadRibbonComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </rad:RadRibbonComboBox.ItemsPanel>
    <rad:RadRibbonComboBox.ItemTemplate>
        <DataTemplate>                                       
            <StackPanel Orientation="Horizontal">
                <TextBlock Background="{Binding ItemBackground}" Text="{Binding MemberDisplay}" HorizontalAlignment="Stretch" />                                       
            </StackPanel>
        </DataTemplate>
    </rad:RadRibbonComboBox.ItemTemplate>                               
</rad:RadRibbonComboBox>


That seems right to me, and when i use this kind of concept for other combos it works ok. Is this something particular to RibbonComboBox controls? I've attached images of how it looks in the application.

Konstantina
Telerik team
 answered on 30 Jan 2012
2 answers
146 views
Hi,

I would like to draw a bar chart and set min and max values for each bar. How to accomplish that?
Martinelli
Top achievements
Rank 1
 answered on 30 Jan 2012
2 answers
108 views
Hello,
I've a combobox defined as

    <telerik:RadComboBox Grid.Row="0" IsEditable="true" SelectedItem="{Binding SelectedDateMode=TwoWay}"
                             x:Name="ComboBox" Height="30" Width="150" ItemsSource="{Binding Collection, Mode=OneWay}"
                             ItemTemplateSelector="{StaticResource itemTemplateSelector}" OpenDropDownOnFocus="True" />

and the template I'm going to use is

 <DataTemplate x:Key="datetimeDataTemplateSelector">
                <TextBlock Text="{Binding Data}"/>
            </DataTemplate>

it's bound to an object of type

   public class TestObject : INotifyPropertyChanged
    {
        public bool IsGeneric { get; set; }

        public DateTime? Data { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;

        public void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
and when the dropdown is open I got the data shown.. when I select an Item I got for the itemtemplate RadControlsWpfApp2.TestObject

Since I cannot specify a DisplayMember how can I tell to show the Data value?
Thanks
Michele
Top achievements
Rank 2
 answered on 30 Jan 2012
4 answers
127 views
I use the GridView in a fashion similar to your example in http://www.telerik.com/help/wpf/gridview-managing-data-add-new-entries.html:
private void radGridView_RowEditEnded( object sender, GridViewRowEditEndedEventArgs e )
{
    if ( e.EditAction == GridViewEditAction.Cancel )
    {
        return;
    }
    if ( e.EditOperationType == GridViewEditOperationType.Insert )
    {
        //Add the new entry to the data base.
        DBUtility.AddEmployee( e.NewData );
    }
}

My "DBUtility.AddEmployee" may return an exception due to a database constraint (e.g. duplicate key). Is there a suggested way to handle this? Any special event?
I would like the result to look approximately the same way as if I was using RowValidating and set the IsValid property to false.

Thanks.
Nedyalko Nikolov
Telerik team
 answered on 30 Jan 2012
3 answers
600 views
Hello.
I am using Telerik 2011.2 in a MVVM application.
What I want to do is round the edges of the entire header row, I have been able to fake it thus far by setting the corner radius for the upper right corner on the GridViewHeaderRow, and templating the left most column's HeaderCellStyle. The problem being that the user cannot rearrange the columns or else it looks very bad. I would like to set the corner radius for the upper right and left corners "above" the individual cells so that it works no matter the order or content of the individual cells. Don't know the property I am looking for. I have tried finding it in expression blend but cannot seem to get the right style in the editor. If you could give me a copy of the default style involved I can modify it is needed, thank you.

Eli
Vanya Pavlova
Telerik team
 answered on 30 Jan 2012
1 answer
118 views
Hello!

I have a problem with updating of layout the ScheduleView control.

i have a code:

    <Grid>
        <DockPanel LastChildFill="True">
            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="10" Height="25">
                <Button Content="Change" Width="100" Click="Button_Click"></Button>
            </StackPanel>
            <telerik:RadScheduleView Name="schedule">
                <telerik:RadScheduleView.ActiveViewDefinition>
                    <scheduleView:TimelineViewDefinition DayStartTime="10:00:00" DayEndTime="20:00:00" Orientation="Vertical" VisibleDays="1" MinTimeRulerExtent="100"></scheduleView:TimelineViewDefinition>
                </telerik:RadScheduleView.ActiveViewDefinition>
            </telerik:RadScheduleView>
        </DockPanel>
    </Grid>

and simple handler of click the 'Change' button:


private void Button_Click(object sender, RoutedEventArgs e)
        {
            schedule.ActiveViewDefinition.DayStartTime = schedule.ActiveViewDefinition.DayStartTime.Add(new TimeSpan(1, 0, 0));
        }


when i am trying to change the DayStartTime/DayEndTime value the height of ScheduleView displays wrong. Height of ScheduleView  just cuts. wihtout any updating of inner grid the ScheduleView control.

Regards,
Stas.
stas
Top achievements
Rank 1
 answered on 30 Jan 2012
5 answers
356 views
Trying to use zoom and scroll MVVM way. ZoomInCommand and ZoomOutCommand get fired however modified MinZoomRange, RangeEnd, RangeStart but zoom is not working. Can you suggest any alternative ?


 <charting:ChartArea Grid.Row="0" Grid.RowSpan="2"
                                       x:Name="chartArea"
                                       Legend="{Binding ElementName=legend}"
                                       EnableAnimations="False"
                                       SmartLabelsEnabled="True"
                                       Padding="5,10,20,10">
 
 
 
                            <charting:ChartArea.ZoomScrollSettingsX>
                                <charting:ZoomScrollSettings ScrollMode="ScrollAndZoom" 
                                                                MinZoomRange="{Binding MinZoomRange, Mode=TwoWay}" 
                                                                RangeEnd ="{Binding RangeEnd, Mode=TwoWay}"
                                                                RangeStart ="{Binding RangeStart, Mode=TwoWay}"/>
                            </charting:ChartArea.ZoomScrollSettingsX>
                            <charting:ChartArea.AxisY>
                                <charting:AxisY AutoRange="True" />
                            </charting:ChartArea.AxisY>
                            <charting:ChartArea.AxisX>
                                <charting:AxisX DefaultLabelFormat="MM.dd&#x0a;yyyy" StepLabelLevelCount="2" />
                            </charting:ChartArea.AxisX>
 
 
 
                        </charting:ChartArea>
 
                        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,10,15,5">
                            <telerik:RadButton Command="{Binding ZoomInCommand}" Margin="5,0" Width="20" Height="20" CornerRadius="16" BorderBrush="{StaticResource StrongBrush}">
                                <Path Stretch="Fill" Width="8" Height="8" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="{StaticResource StrongBrush}"/>
                            </telerik:RadButton>
                            <telerik:RadButton Command="{Binding ZoomOutCommand}" Margin="5,0" Width="20" Height="20" CornerRadius="16" BorderBrush="{StaticResource StrongBrush}">
                                <Path Stretch="Fill" Width="8" Height="8" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="{StaticResource StrongBrush}"/>
                            </telerik:RadButton>
                        </StackPanel>

View Model
        #region zoom
    
 
        ICommand _zoomInCommand;
        public ICommand ZoomInCommand
        {
            get
            {
                if (_zoomInCommand == null)
                {
                    _zoomInCommand = new DelegateCommand(ZoomIn, CanZoomIn);
                }
                return _zoomInCommand;
            }
        }
 
        ICommand _zoomOutCommand;
        public ICommand ZoomOutCommand
        {
            get
            {
                if (_zoomOutCommand == null)
                {
                    _zoomOutCommand = new DelegateCommand(ZoomOut, CanZoomOut);
                }
                return _zoomOutCommand;
            }
        }
 
 
 
		private double _MaxZoomRange;
		public double MaxZoomRange
		{
			get { return _MaxZoomRange;}
			set
			{
				{
					_MaxZoomRange = value;
					OnPropertyChanged(()=>this.MaxZoomRange);
				}
			}
		} 
 
        
		private double _Range;
		public double Range
		{
			get { return _Range;}
			set
			{
				{
					_Range = value;
					OnPropertyChanged(()=>this.Range);
				}
			}
		} 
    
 
		private double _RangeEnd;
		public double RangeEnd
		{
			get { return _RangeEnd;}
			set
			{
				{
					_RangeEnd = value;
					OnPropertyChanged(()=>this.RangeEnd);
				}
			}
		} 
        
    
		private double _RangeStart;
		public double RangeStart
		{
			get { return _RangeStart;}
			set
			{
				{
					_RangeStart = value;
					OnPropertyChanged(()=>this.RangeStart);
				}
			}
		} 
    
        
		private double _MinZoomRange;
		public double MinZoomRange
		{
			get { return _MinZoomRange;}
			set
			{
				{
					_MinZoomRange = value;
					OnPropertyChanged(()=>this.MinZoomRange);
				}
			}
		} 
    
        //
        // Summary:
        //     Gets or sets the scroll mode.
        
        public ScrollMode ScrollMode { getset; }
        //
        // Summary:
        //     Gets or sets the slider selection end.
        
        public double SliderSelectionEnd { getset; }
        //
        // Summary:
        //     Gets or sets the slider selection start.
        
        public double SliderSelectionStart { getset; }
        
 
        public void ZoomIn(object parameter)
        {
 
            double zoomCenter = RangeStart + (Range / 2);
            double newRange = Math.Max(MinZoomRange, Range) / 2;
            RangeStart = Math.Max(0, zoomCenter - (newRange / 2));
            RangeEnd = Math.Min(1, zoomCenter + (newRange / 2));
 
 
            ((DelegateCommand)_zoomInCommand).InvalidateCanExecute();
            ((DelegateCommand)_zoomOutCommand).InvalidateCanExecute();
        }
 
        public bool CanZoomIn(object parameter)
        {
 
            return Range > MinZoomRange;
        }
 
        public void ZoomOut(object parameter)
        {
 
            double zoomCenter = RangeStart + (Range / 2);
            double newRange = Math.Min(1, Range) * 2;
 
            if (zoomCenter + (newRange / 2> 1)
                zoomCenter = 1 - (newRange / 2);
            else if (zoomCenter - (newRange / 2< 0)
                zoomCenter = newRange / 2;
 
            RangeStart = Math.Max(0, zoomCenter - newRange / 2);
            RangeEnd = Math.Min(1, zoomCenter + newRange / 2);
 
 
 
            ((DelegateCommand)_zoomInCommand).InvalidateCanExecute();
            ((DelegateCommand)_zoomOutCommand).InvalidateCanExecute();
        }
 
        public bool CanZoomOut(object parameter)
        {
 
            return Range < 1d;
        }
        #endregion
        public ViewModel()
        {
            MinZoomRange = 0.005;
            Range = 1.0;
            RangeEnd = 1.0;
            RangeStart = 0.0;
        }
Yavor
Telerik team
 answered on 30 Jan 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
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?