Telerik Forums
UI for WinForms Forum
1 answer
74 views
Hello!

I've build a CustomControl derived from RadTreeView and overwritten the Click method from the RadTreeView.
I want to use the default Telerik - Theme like in my other RadControls
Properties:
         ThemeClassName: Telerik.WinControls.UI.*RadTreeView*,
         ThemeName: ControlDefault or mostly string empty

When i use the CustomControl i loose all the default view settings of the RadTreeView.
Selection and Mouse Over etc. displayed as white.
Functionality works as expected.
I tried to copy the Telerik.WinControls.UI.RadTreeView to the ThemeClassName property of the Control.
But this doesn't work.
How can i use the default behaviour view of the RadTreeView in my CustomControl?

Thanks and kind regards
Ivan Petrov
Telerik team
 answered on 21 Nov 2011
5 answers
260 views
We're using a custom collection to handle the modifications to the items bound to the RadGridView. Everything's working as expected for all but adding items. We've found out that the Telerik grid is using IList<T> data sources as IList, which means that our custom collection have to implement it as well, in order to respect our logic.

When the grid is trying to add a new item to the collection, the grid calls the IList.Add(object item) instead of IList<T>.Add(T item).

The error message displayed by the grid is "The collection is read-only."

We would expect the grid to determine the proper type of the collection in the data source.

Current version (without IList implementation):
public class EntityStateCollection<T> : IList<T> where T : new()
{
    #region Membres
    private List<EntityState<T>> _entityStates;
    private Enumerator<T> _innerEnumerator;
  
    public event EventHandler ItemAdded;
    public event EventHandler ItemDeleted;
    public event EventHandler ItemModified;
    #endregion
  
    #region Enumerator
  
    [Serializable, StructLayout(LayoutKind.Sequential)]
    public struct Enumerator<T> : IEnumerator<T>, IDisposable, IEnumerator where T : new()
    {
        private List<EntityState<T>> list;
        private int index;
        private T current;
        internal Enumerator(List<EntityState<T>> list)
        {
            this.list = list;
            this.index = 0;
            this.current = default(T);
        }
  
        public void Dispose()
        {
        }
  
        public bool MoveNext()
        {
            List<EntityState<T>> list = this.list;
            if (this.index < list.Count)
            {
  
                this.current = list[this.index].InnerObject;
                this.index++;
                return true;
            }
            else
            {
                this.current = default(T);
                return false;
            }
        }
  
        public T Current
        {
            get
            {
                return this.current;
            }
        }
        object IEnumerator.Current
        {
            get
            {
                return this.Current;
            }
        }
        void IEnumerator.Reset()
        {
            this.index = 0;
            this.current = default(T);
        }
    }
    #endregion Enumerator
  
    public EntityStateCollection()
    {
        _entityStates = new List<EntityState<T>>();
        _innerEnumerator = new Enumerator<T>(_entityStates);
    }
  
    public void SetModified(T item)
    {
        EntityState<T> entity = _entityStates[this.IndexOf(item)];
  
        if (entity.ObjectState != State.Added)
        {
            entity.ObjectState = State.Modified;
            this.ItemModified(entity, null);
        }
    }
  
    /// <summary>
    /// Returns true if all T entities are at Current state.
    /// </summary>
    /// <returns></returns>
    public bool IsInCurrentState()
    {
        for (int i = 0; i < _entityStates.Count; i++)
        {
            if (_entityStates[i].ObjectState != State.Current)
            {
                return false;
            }
        }
  
        return true;
    }
  
    public EntityState<T> GetEntityState(int i)
    {
        return _entityStates[i];
    }
  
    /// <summary>
    /// Add a list of T objects to the collection with the Current state
    /// </summary>
    /// <param name="lst"></param>
    public void AddRange(List<T> lst)
    {
        foreach (T item in lst)
        {
            _entityStates.Add(new EntityState<T>(State.Current, item));
            //this.ItemAdded(_entityStates[this.IndexOf(item)], null);
        }
    }
  
    #region IList<T> Membres
    public int IndexOf(T item)
    {
        int itemIndex = -1;
        for (int i = 0; i < _entityStates.Count; i++)
        {
            if (_entityStates[i].InnerObject.Equals(item))
            {
                itemIndex = i;
                break;
            }
        }
        return itemIndex;
    }
  
    public void Insert(int index, T item)
    {
        _entityStates.Insert(index, new EntityState<T>(State.Added, item));
        this.ItemAdded(_entityStates[index], null);
    }
  
    public void RemoveAt(int index)
    {
        _entityStates[index].ObjectState = State.Deleted;
        this.ItemDeleted(_entityStates[index], null);
    }
  
    public T this[int index]
    {
        get
        {
            return _entityStates[index].InnerObject;
        }
        set
        {
            _entityStates[index].InnerObject = value;
        }
    }
    #endregion
  
    #region ICollection<T> Membres
    public void Add(T item)
    {
        _entityStates.Add(new EntityState<T>(State.Added, item));
        this.ItemAdded(_entityStates[this.IndexOf(item)], null);
    }
  
    public void Clear()
    {
        _entityStates.Clear();
    }
  
    public bool Contains(T item)
    {
        for (int i = 0; i < _entityStates.Count; i++)
        {
            if (_entityStates[i].InnerObject.Equals(item))
            {
                return true;
            }
        }
  
        return false;
    }
  
    public void CopyTo(T[] array, int arrayIndex)
    {
        throw new NotImplementedException();
    }
  
    public int Count
    {
        get { return _entityStates.Count; }
    }
  
    public bool IsReadOnly
    {
        get { return false; }
    }
  
    public bool Remove(T item)
    {
        for (int i = 0; i < _entityStates.Count; i++)
        {
            if (_entityStates[i].InnerObject.Equals(item))
            {
                _entityStates[i].ObjectState = State.Deleted;
                this.ItemDeleted(_entityStates[i], null);
  
                return true;
            }
        }
  
        return false;
    }
    #endregion
  
    #region IEnumerable et IEnumerable<T> Membres
    public IEnumerator<T> GetEnumerator()
    {
        return this._innerEnumerator;
    }
  
    IEnumerator IEnumerable.GetEnumerator()
    {
        return this._innerEnumerator;
    }
    #endregion
Julian Benkov
Telerik team
 answered on 21 Nov 2011
2 answers
142 views
In your documentation it demonstrates the use of the ExpressionFormattingObject, but I am unable to find the object anywhere in the Telerik.Wincontrols.UI namespace.  Also references are for the 2011.2.11.831 build which is when the documentation said that it was introduced.

Any help would be appreciated...
Bobby Ross
Top achievements
Rank 1
 answered on 18 Nov 2011
3 answers
207 views
I have a scenario where the client wants to see "assigned" employees at the top of the list.  An assigned employee has multiple criteria, some of which are based on visible columns, some invisible.  I want this to always be the default sort and not allow the user to change it.  I also don't want to see the arrows over the visible columns.

Any help would be appreciated!
Alexander
Telerik team
 answered on 18 Nov 2011
2 answers
161 views
Hi all,

I'm using several MaskedTextBoxes and have the Mask property set to "C" for currency and the MaskType set to Numeric. This works fine however I cannot seem to enter a value higher than 9.99.

I have looked for a solution online but can only find how to change the number of decimal places "C3" for example.

Is this possible? Should I be using a custom Mask of some kind?

Regards,


Guy
Peter
Telerik team
 answered on 18 Nov 2011
3 answers
458 views
Hi,

    i have a form with one button called next .when we click next it will invoke another instance of the same form ,so i want to close the old form before open the new instance of the form.  i am unable to acheieve this. any suggestions on this issue will be helpful for me to solve this issue.

following is the code snippet which i used for the testing purpose of the above said scenario.

   
private void ra_Load(object sender, EventArgs e)
        {
            List<string> firstname = new List<string>();
 
            firstname.Add("SAM");
            firstname.Add("TAYLOR");          
            firstname.Add("ROSE");
 
            GridViewDataRowInfo row;
            for (int i = 0; i < firstname.Count; i++)
            {
                    row = radGridView1.Rows.AddNew();
                    row.Cells[0].Value = firstname[i];               
            }          
        }
 
        private void btnNext_Click(object sender, EventArgs e)
        {
            //this.Close();
            ra newra = new ra();
            newra.ShowDialog();           
        }

Regards,
Selva
Ivan Petrov
Telerik team
 answered on 18 Nov 2011
3 answers
374 views
Hi mates,
When I try to insert into a chunk a horizontal radRibbonBarButtonGroup and a vertical radRibbonBarButtonGroup and both of these have Autosize set to false and the size property is set to a fixed size,  and into these groups(radRibbonBarButtonGroup) I've added radButtonElements at design time, they also have fixed size (Width and Height), my controls (RadButtonElements and RadRibbonBarButtonGroups) sets automatically the size to 0,0 (and, of course, are disappeared)  at Run Time.
I've verified in RadRibbonForm Designer code (the form that contain the RadRibbonBar), that there is no code of  the  size property of the controls.
Should  I write the size manually into designer code? or is there another property that hide my controls (in advertently)?
Just to mention that RibbonBar will have 7 tabs with around 20 chunks.
Peter
Telerik team
 answered on 18 Nov 2011
2 answers
303 views
Anyone have ideas of why my dockstyle.fill is not working for radgridview inside a usercontrol (winforms).  I place the usercontrol inside a form and the usercontrol fills, but the radgridview stays same size.  Thanks
Stefan
Telerik team
 answered on 18 Nov 2011
5 answers
631 views
What's the equivalent of

RadListBox.SelectedItems.Clear()

with the new control?
Peter
Telerik team
 answered on 17 Nov 2011
1 answer
114 views
Hi,

I'm working with RadForm in MDI Mode. I Just added a main form with IsMdiContainer = True and I added some children RadForm setting the properties MdiParent. I'm using Telerik WinForm Q2 2011.

ISSUE: When I maximize one Child RadForm, the "Maximize" icon in the top-right corner of the form doesn't change. Instead of the "Restore Down" icon, the RadForms shows always the "Maximize" icon. See the attached picture for a screenshot of this problem.

Thanks in advance,
Lorenzo
Ivan Petrov
Telerik team
 answered on 17 Nov 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
NavigationView
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?