Telerik Forums
UI for WPF Forum
0 answers
97 views
Hi guys,
basically I have a class derived from GridViewGroupFooterCell, and I need to replace GridViewGroupFooterCell with the derived one in the GridView. Do you guys have any idea how I can archive this?

Thanks in advance.

-Henry
heng
Top achievements
Rank 1
 asked on 05 Jun 2012
3 answers
89 views
Is it possible to 'freeze' the groupheader row?
This way the current group would always be visible while (vertically) scrolling the data in the gridview.
Vlad
Telerik team
 answered on 05 Jun 2012
1 answer
174 views

Hi,

 

I have a requirement

 

Requirement 1# : Inside a Hirerchy Template placed 2 Grids where in

1st grid 3 columns where 1 column has Combo Box loaded with Values.

 

For ex: Football, Disco

 

If i select Football, 2 grid placed inside Hirechy Template should be visible or else visbility of that grid should be collapsed.

How can i solve this.

 

Requirement 2#: Can i pass Observable collection as converter parameter

 

<Radcombobox selecteditem={Binding collection, converter={}} -> to show as like A,B,C (Selected Items as comma separated)

 

<controls:RadGridView Name="clubsGrid" 
                      ItemsSource="{Binding Clubs}" Grid.Row="0" 
                  AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" DataContext="{StaticResource MyViewModel}">
            <controls:RadGridView.ChildTableDefinitions>
                <controls:GridViewTableDefinition/>
            </controls:RadGridView.ChildTableDefinitions>
            <controls:RadGridView.Columns>
                <controls:GridViewDataColumn DataMemberBinding="{Binding Name}"
                                            Header="Est."></controls:GridViewDataColumn>
                <controls:GridViewDataColumn DataMemberBinding="{Binding Established}"></controls:GridViewDataColumn>
            </controls:RadGridView.Columns>
            <controls:RadGridView.HierarchyChildTemplate>
                <DataTemplate                      
                                            <controls:RadGridView Name="playersGrid" 
                                     ItemsSource="{Binding Players}" 
                                     AutoGenerateColumns="False" EnableRowVirtualization="False" EnableColumnVirtualization="False"
                                        <controls:RadGridView.ChildTableDefinitions>
                <controls:GridViewTableDefinition/>
            </controls:RadGridView.ChildTableDefinitions>

                            <controls:RadGridView.Columns>
                                <controls:GridViewDataColumn DataMemberBinding="{Binding Name}">                                    
                                </controls:GridViewDataColumn>
                                <controls:GridViewDataColumn DataMemberBinding="{Binding SelectedItem.Name}">
                                    <controls:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <RadControls:RadComboBox ItemsSource="{Binding Hobbies, Mode=OneTime}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" SelectedValue="Name" DisplayMemberPath="Name" >                                                
                                            </RadControls:RadComboBox>                                            
                                        </DataTemplate>
                                    </controls:GridViewDataColumn.CellEditTemplate>
                                </controls:GridViewDataColumn>                         
                            </controls:RadGridView.Columns
                                    

<

 

 

telerik:RadGridView.HierarchyChildTemplate>

 

 

 

 

<HierarchicalDataTemplate>

 


                                    <controls:RadGridView Name="Hobbies" 
                                     ItemsSource="{Binding Hobbies}" 
                                     AutoGenerateColumns="True" EnableRowVirtualization="False" EnableColumnVirtualization="False"/>

            
                        </controls:RadGridView>

</

 

 

HierarchicalDataTemplate>

 

 

 

 

</telerik:RadGridView.HierarchyChildTemplate>

 


                                                                </DataTemplate>
            </controls:RadGridView.HierarchyChildTemplate>
        </controls:RadGridView>
Prakash
Top achievements
Rank 1
 answered on 05 Jun 2012
1 answer
85 views
I,

in my project I use Telerik V2010.3.1314.35 and with my RadGridView, when I click on the filter icon in a column header, sometime the filter dialog appear behind the grid ?!?

Thank's
Vlad
Telerik team
 answered on 05 Jun 2012
2 answers
170 views
I have created a custom popup user control. This control covers the entire application with a gray semi-transparent overlay with a message in the middle. 

I add the control like this which makes it the last control in the grid and putting it on top of all other objects.
Grid mainGrid = (Grid)App.Current.MainWindow.Content;
mainGrid.Children.Insert(mainGrid.Children.Count, this);

I have a docking control in this grid and as long as everything is docked the overlay works great. However, as soon as I pull one of the RadPanes into a separate ToolWindow that tool window is always on top of my overlay user control. Is there anyway to do an overlay that would be on top of the ToolWindow as well?

Dev
Top achievements
Rank 1
 answered on 04 Jun 2012
1 answer
531 views
I have a project where I programmatically create and add RadPanes to a RadDocking control. When the user closes the RadPane it doesn't get garbage collected.

I'm using Redgate's ANTS Memory Profiler to confirm this, and I can see RadDocking control maintains an array of EffectiveValueEntrys which stop the GC collecting the RadPane.

I've seen this thread : http://www.telerik.com/community/forums/wpf/docking/why-not-dispose-of-radpanes-memory-leak-issue.aspx  and have implemented the solution (RemoveFromParent and e.Handled = true), but this still doesn't solve the problem (it does solve another issue we were having so I still need that code in there).

The RadPane is created

var pane = new RadPane();
 
var paneGroup = new RadPaneGroup();
paneGroup.Items.Add(pane);
 
var splitContainer = new RadSplitContainer();
splitContainer.Items.Add(paneGroup);
 
this.dockingControl.Items.Add(splitContainer);
pane.MakeFloatingDockable();

I've attached a screenshot of the ANTS profiler Retention Graph for the RadPane. I'm unable to attach a zip file containing a sample project which shows the problem (although you'll need to be running a memory profiler to see the bug), as I can only upload (gif, jpg, jpeg or png) but I have it ready to upload if there is an alternative upload facility.

Could you please advise me on how to fix this problem. Is this a known bug, or am I simply creating/destroying the pane incorrectly?

Kind regards,

Rich Keenan
Adam Marshall
Top achievements
Rank 1
 answered on 04 Jun 2012
1 answer
157 views
Hi,

I programmed a custom annotation insertion and, I have an issue when custom annotation's prefix are exported. Here is the fragment of code to make the custom annotation:
Public Class NovoBookMarkRangeStart
    Inherits FieldRangeStartBase
  
    Private m_Name As String
    Private m_TypeCase As Integer
    Private m_BookFormat As String
  
    <XamlSerializable()> _
    Public Property BookFormat As String
        Get
            Return m_BookFormat
        End Get
        Set(value As String)
            m_BookFormat = value
        End Set
    End Property
  
    <XamlSerializable()> _
    Public Property Name() As String
        Get
            Return m_Name
        End Get
        Set(value As String)
            m_Name = value
        End Set
    End Property
  
    <XamlSerializable()> _
    Public Property TypeCase() As Integer
        Get
            Return m_TypeCase
        End Get
        Set(value As Integer)
            m_TypeCase = value
        End Set
    End Property
  
      
  
    Public Sub New()
    End Sub
  
    Public Sub New(name As String, TypeCase As Integer, Bookformat As String)
        Me.TypeCase = TypeCase
        Me.Name = name
        Me.BookFormat = Bookformat
    End Sub

Here is the code to put the annotation in the document :
Private Sub Wpf_NewBookMark(ID As Integer,  TypeCase As Integer, BookFormat As String) Handles Wpf.NewBookMark
         
       Dim StartRange As New NovoBookMarkRangeStart(ID.ToString, TypeCase, BookFormat)
       Dim EndRange As New NovoBookMarkRangeEnd()
       'Caret Position
       Dim S As New DocumentPosition(Me.editor.Document.CaretPosition)
       Dim E As New DocumentPosition(Me.editor.Document)
       EndRange.PairWithStart(StartRange)
       'Custom Span
       Dim BookMarkSpan As New Span("{" & Id.ToString() & "}")
       S.AnchorToCurrentBoxIndex()
       editor.InsertInline(StartRange)
       editor.InsertInline(BookMarkSpan)
       editor.InsertInline(EndRange)
       S.RestorePositionFromBoxIndex()
       editor.UpdateEditorLayout()
         
   End Sub

So, when I save the document under a .XAML format, the section with the custom annotation does not save the TypeCase value but put the prefix and, the BookFormat prefix is not there at all. On the other hand, the Name prefix is with the good value. Here is a sample fragment :

<t:Section PageMargin="96,96,96,96" PageSize="816,1056">
    <t:Paragraph LineSpacing="1" StyleName="Normal">
      <custom1:NovoBookMarkRangeStart AnnotationID="1" Name="5" TypeCase="0" />
      <t:Span Text="{}{Patient.PostalCode}" />
      <custom1:NovoBookMarkRangeEnd AnnotationID="1" />
    </t:Paragraph>
  </t:Section>

So, can you find why the BookFormat prefix and value are not present and, why the the TypeCase value is the wrong one?

Thank a lot,

Patrick
Iva Toteva
Telerik team
 answered on 04 Jun 2012
1 answer
103 views

I find that when I decorate a RadRibbonTab with a ContextualGroupName, elements in the tab no longer resize. Is there a known issue with Contextual Tabs that prevents them from resizing as normal RadRibbonTabs do?
Tina Stancheva
Telerik team
 answered on 04 Jun 2012
1 answer
198 views
Hi,

My WPF application uses an SQlite database which exposes is functionality by an OpenAccess ORM Domain Model, and is then wrapped in an MVVM schema. One of the tables in the database is called ValidUsers, I have created a Metadata class called ValidUsersMetadata as per the guidance in the OpenAccess documentation and is shown below:

using System;
using System.Linq;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
 
namespace VisorDataModel
{
    [MetadataTypeAttribute(typeof(ValidUser.ValidUserMetadata))]
    public partial class ValidUser : IEditableObject
    {
 
        internal sealed class ValidUserMetadata
        {
 
            public ValidUserMetadata()
            {
            }
 
            [Required(ErrorMessage = "User ID is required")]
            public int UserID
            {
                get;
                set;
            }
 
           [Required(ErrorMessage = "User Name is required.")]
           [StringLength(6,ErrorMessage="User name must be at least 6 characters")]
           public string UserName
            {
                get;
                set;
            }
 
           [Required(ErrorMessage = "Password is required.")]
           [StringLength(6, ErrorMessage = "Password must be at least 6 characters")]
           public string UserPassword
            {
                get;
                set;
            }
 
           [Required(ErrorMessage = "User Class is required.")]
           public int UserClass
            {
                get;
                set;
            }
 
        }
    }
}

The base ValidUser definition is in the class VisorDataModel which is generated by the OpenAccess Domain Model wizard.

The rest of the MVVM definitions for ValidUsers are shown below:
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace VisorDataModel
{
    public interface IValidUsersModel
    {
        IEnumerable<ValidUser> LoadValidUsers();
        IEnumerable<UserClass> LoadUserClasses();
        ValidUser NewValidUser();
        void AddValidUser(ValidUser validUser);
        void DeleteValidUser(ValidUser validUser);
        void SaveChanges();
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace VisorDataModel
{
 
    /// <summary>
    /// Represents a source of ValidUsers
    /// </summary>
    public class ValidUsersModel : IValidUsersModel
    {
        private EntitiesModel dbContext = new EntitiesModel();
 
        public IEnumerable<ValidUser> LoadValidUsers()
        {
            return dbContext.ValidUsers.ToList();
        }
 
        public IEnumerable<UserClass> LoadUserClasses()
        {
            return dbContext.UserClasses.ToList();
        }
 
        public ValidUser NewValidUser()
        {
            ValidUser newValidUser = new ValidUser { UserName = "New User", UserPassword = "New Password", UserClass = 0 };
 
            int newUserId = 0;
            try
            {
                newUserId = (from vu in dbContext.ValidUsers
                             select (vu.UserID)).Max() +1;
            }
            catch
            {
                newUserId = 0;
            }
            newValidUser.UserID = newUserId;
            return newValidUser;
       }
        public void AddValidUser(ValidUser validUser)
        {
            dbContext.Add(validUser);
            dbContext.SaveChanges();
        }
 
        public void DeleteValidUser(ValidUser validUser)
        {
            dbContext.Delete(validUser);
            dbContext.SaveChanges();
        }
 
        public void SaveChanges()
        {
            dbContext.SaveChanges();
        }
    }
}
using System;
using System.Linq;
using System.Collections.ObjectModel;
using System.ComponentModel;
 
namespace VisorDataModel
{
    public class ValidUsersViewModel : INotifyPropertyChanged
    {
 
        private readonly IValidUsersModel dataModel;
        private ValidUser _selectedValidUser;
        private DelegateCommand _addValidUserCommand;
        private DelegateCommand _deleteValidUserCommand;
        private DelegateCommand _saveChangesCommand;
        private ObservableCollection<ValidUser> _validUsers;
        private ObservableCollection<UserClass> _userClasses;
        public event PropertyChangedEventHandler PropertyChanged;
        private ObservableCollection<ValidUser> _originalValidUsers;
 
        #region initialisation
        public ValidUsersViewModel()
        {
            this.dataModel = new ValidUsersModel();
        }
        #endregion
 
        public ObservableCollection<ValidUser> ValidUsers
        {
            get
            {
                if (this._validUsers == null)
                {
                    this._validUsers = new ObservableCollection<ValidUser>();
 
                    if (this._originalValidUsers == null)
                    {
                        this._originalValidUsers = this._validUsers;
                    }
 
                    LoadValidUsers();
                }
 
                return this._validUsers;
            }
        }
 
        public ObservableCollection<UserClass> UserClasses
        {
            get
            {
                if (this._userClasses == null)
                {
                    this._userClasses = new ObservableCollection<UserClass>();
                    LoadUserClasses();
                }
                return this._userClasses;
            }
        }
 
        #region SelectValidUser property
        public ValidUser SelectedValidUser
        {
            get
            {
                return _selectedValidUser;
            }
            set
            {
                if (this._selectedValidUser == value)
                    return;
                this._selectedValidUser = value;
                this.OnPropertyChanged("SelectedValidUser");
            }
        }
        #endregion
 
        public DelegateCommand AddValidUserCommand
        {
            get
            {
                if (this._addValidUserCommand == null)
                    this._addValidUserCommand = new DelegateCommand(this.OnAddCommandExecute);
                return _addValidUserCommand;
            }
        }
 
        public DelegateCommand DeleteValidUserCommand
        {
            get
            {
                if (this._deleteValidUserCommand == null)
                    this._deleteValidUserCommand = new DelegateCommand(this.OnDeleteCommandExecute);
                return _deleteValidUserCommand;
            }
        }
 
        public DelegateCommand SaveChangesCommand
        {
            get
            {
                if (this._saveChangesCommand == null)
                    this._saveChangesCommand = new DelegateCommand(this.OnSaveCommandExecute);
                return _saveChangesCommand;
            }
        }
 
        private void LoadValidUsers()
        {
            this._validUsers.Clear();
            foreach (var item in this.dataModel.LoadValidUsers())
            {
                this._validUsers.Add(item);
            }
        }
 
        private void LoadUserClasses()
        {
            this._userClasses.Clear();
            foreach (var item in this.dataModel.LoadUserClasses())
            {
                this._userClasses.Add(item);
            }
        }
 
        private void OnAddCommandExecute(object parameter)
        {
            ValidUser newValidUser = this.dataModel.NewValidUser();
            this.ValidUsers.Add(newValidUser);
            this.SelectedValidUser = newValidUser;
            this.dataModel.AddValidUser(newValidUser);
        }
 
        private void OnDeleteCommandExecute(object parameter)
        {
            if (this.SelectedValidUser != null)
            {
                this.dataModel.DeleteValidUser(this.SelectedValidUser);
                this.ValidUsers.Remove(this.SelectedValidUser);
            }
        }
 
        private void OnSaveCommandExecute(object parameter)
        {
            this.dataModel.SaveChanges();
        }
 
        protected virtual void OnPropertyChanged(string info)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
}



One of the functions of the application is to display/add/delete/edit ValidUser records. This is accomplished by a RadDataGrid and a pop-up RadDataForm. The RadDataForm uses custom fields, one of which is defined as a DataFormComboBoxField.

All of this works fine but I now want to use the DataAnnotations which I have added in the ValidUserMetadata class. So far I have not found how to do this.

Any help gratefully received.

Thanks
Ivan Ivanov
Telerik team
 answered on 04 Jun 2012
2 answers
205 views
Hello all,

I have a case where a 'parent' tab control contains a 'child' tab control in each of its tabs. So we have something like:

PT1 (parent tab 1)
     -> CT1 (child tab 1)
     -> CT2
     -> CT3
PT2 (parent tab 2)
     -> CT4
     -> CT5
     -> CT6 

Say that in Parent Tab 1 (PT1), I select the second child tab (CT2). Then I move to PT2 and select any other child tab. When I return to PT1, I would expect my previous child tab selection (CT2) to be preserved. Instead, the child tab control is 'reset' to no selection.

Is there a property to set so that 'child' user control states such as child controls are preserved when switching between tabs?

My apologies, this question seems awfully complicated for such a simple case... it would be awesome if we could upload some projects to the forum for customer support to try out! :-)

Thanks for your help,

Simon
Simon
Top achievements
Rank 1
 answered on 04 Jun 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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?