Telerik Forums
UI for WinForms Forum
2 answers
88 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
226 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
95 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
341 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
176 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
273 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
208 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
521 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
421 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
346 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
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?