Telerik Forums
UI for WinForms Forum
3 answers
328 views
Hello,

Is there a way to capture the Escape key just before the RadTreeView controls exists the edit mode? We have a workflow in which a node can be added and the control is set to the edit mode, so the user is foced to update the node text. But if the user cancels editing by pressing Escape we want to remove the node and keep it if the user pressed Enter. Which we could do in the standard TreeView control by using the KeyPress event. But the RadTreeView does not fire the KeyPress event when it enters the edit mode. Is there a work around this issue or i will need to submit a feature request?

Thanks,
Grigoriy
V
Top achievements
Rank 1
 answered on 22 Nov 2011
1 answer
132 views
Hi,

in the same column, I can have 2 different types of cells?

i have this need:

Col1      Col 2     Col 3
text text text
text text text
text text Image
text text Image

Thank


Jack
Telerik team
 answered on 21 Nov 2011
3 answers
339 views
I have my RadPageView control setup as ViewMode "Outlook" in my winforms C# application. In my requirement, I have a limited space to display the control (about 600px of height). When the control has more than 5 pages added, the view panel (the open area above the page selectors) is made smaller and cuts off the content. I would like to know if there is a way to enforce a minimum height on this area so that the control will automatically collapse page selectors it cannot fit in this confined space. I need about 300px of height for each page.

I have already tried setting the MinimumSize property on each RadPageViewPage. However, when I do this, the page view page "bleeds" over the top of the page selectors. I was expecting the grip to automatically resize to allow for this minimum height requirement.

Please see the screen shots from my sample application attached.

Edit:
I am using the RadPageView control from Q2 2011 SP1

Update:
I was able to achieve what I was looking for using the following code snippet and calling it from the "Initialized" and "Resized" events. I would still like to know if the control already supports this without having to write this snippet.

private void adjustPageViewGrip()
{
    RadPageViewOutlookElement viewElement = (RadPageViewOutlookElement)radPageView.ViewElement;
    int minHeight = 310;
    int itemHeight = radPageView.SelectedPage.Item.Size.Height;
    int selectedPageHeight = radPageView.SelectedPage.Height;
 
    if (selectedPageHeight < minHeight)
    {
        int hide = (int)Math.Ceiling((double)(minHeight - selectedPageHeight) / (double)itemHeight);
        if (hide > 0)
        {
            viewElement.HideItems(hide);
        }
    }
    else if ((selectedPageHeight + itemHeight) >= minHeight)
    {
        int show = (int)Math.Floor((double)(selectedPageHeight - minHeight) / (double)itemHeight);
        if (show > 0)
        {
            viewElement.ShowItems(show);
        }
    }
}


Stefan
Telerik team
 answered on 21 Nov 2011
2 answers
92 views
I was just looking at some demos, looked at code and decided to do a copy and paste to Visual Studio 2010.

I was surprised to see all of the code render onto ONE LINE.

Using JustCode Reformat -- semi-fixed it... at least until the first comment line... repeated until the code was across.

It would be nice to have:
  • Copy Code button on the demo page... which keeps the formatting...
  • Have the ability to copy selections while retaining formats.
Thanks!
Stefan
Telerik team
 answered on 21 Nov 2011
5 answers
237 views
I am building a virtual mode grid where I manage everything from loading, sorting and filtering

But I am stuck in filtering where I want to display my own controls at the top of each column with filtering enabled nad then start filtering over my data source when user press enter

I search the forumn regarind any similar solution but with no luck

Plese help
Julian Benkov
Telerik team
 answered on 21 Nov 2011
1 answer
100 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
364 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
190 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
282 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
216 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
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)
Form
Chart (obsolete as of Q1 2013)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?