Telerik Forums
UI for WinForms Forum
5 answers
286 views
I am using the rad panel to hold items that may scroll.  I would like to skin the scrollbars that are in the rad panel much like the vertical and horizontal scrollbars allow.  Is this possible?
Deyan
Telerik team
 answered on 12 Feb 2010
1 answer
105 views
The following works;
GridGroupByExpression groupBy = new GridGroupByExpression();
groupBy.Expression = "[Status] format \"Current {0}: {1}\" Group By Status DESC";
this.fundsGrid.MasterGridViewTemplate.GroupByExpressions.Add(groupBy);

The following doesnt work

GridGroupByExpression groupBy = new GridGroupByExpression();
groupBy.Expression = "[Status] format \"Current {0}: {1}\" Group By Status desc";
this.fundsGrid.MasterGridViewTemplate.GroupByExpressions.Add(groupBy);

:o)
Julian Benkov
Telerik team
 answered on 12 Feb 2010
7 answers
231 views
A RadForm based application will crash (unhandled exception) if any accent key ( ^ , ´ , ` ) is pressed.

You can easily reproduce this with the telerik WinForms demos:
* Run the Telerikt Examples demo application
* Then open for example
  * Integration -> Themes Color Blending
  * Integration -> File Explorer and focus the grid on the right but don't enter edit mode
  * Forms & Dialogs -> RadForm First Look
  * or GridView -> Hierarchy and focus any grid but don't enter edit mode
* hit any accent key (e.g. ^)

The application will in best case show an "Unhandled exception" dialog - or crash completely like the RadForms First Look.

For us this is a critical bug as we develop a crucial inhouse system - and the users often need accent keys (for typing french names for example). But they earn crashes all the way...

Regards,
ReneMT
Deyan
Telerik team
 answered on 11 Feb 2010
4 answers
287 views
Hello,
I have encountered this exception when handling KeyPress event. I am from Czech Republic and we have specific characters, for example: ˇ - it's KeyChar 711 (examining KeyPressEventArgs in standard GridView control which lacks the bug). However when trying to type this character on RadGridView the exception is thrown.

The only solution that I can think of right now is overriding PreProcessMessage or ProcessDialogKey on RadGridView subclass - so not allowing the characters to be passed to the application (so as not to get the exception) I have not try it just yet though.

System.OverflowException was unhandled
  Message="Value was either too large or too small for an Int32."
  Source="mscorlib"
  StackTrace:
       v System.Convert.ToChar(Int32 value)
       v Telerik.WinControls.UI.BaseGridBehavior.ProcessAlphaNumericKey(KeyEventArgs keys)
       v Telerik.WinControls.UI.BaseGridBehavior.ProcessKey(KeyEventArgs keys)
       v Telerik.WinControls.UI.RadGridView.ProcessDialogKey(Keys keyData)
       v System.Windows.Forms.Control.PreProcessMessage(Message& msg)
       v System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
       v System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
       v System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
       v System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       v System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       v System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       v System.Windows.Forms.Application.Run(Form mainForm)
       v WindowsFormsApplication2.Program.Main() v C:\Users\nguyen\Documents\Visual Studio 2008\Projects\WindowsFormsApplication2\WindowsFormsApplication2\Program.cs:řádek 18
       v System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       v System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       v Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       v System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       v System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       v System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Jack
Telerik team
 answered on 11 Feb 2010
1 answer
368 views
Hello,
I have a Winforms RadCombo box for which I am attempting to set a class derived from CollectionBase as the DataSource. I find that the DisplayMember of the comboxbox is set to an empty string. The ValueMember retains the correct column setting.

Any help is really appreciated...

Here are the relevant pieces of code:

FixedBillingPackageList.cs
===============================
 public class FixedBillingPackageList : ReadOnlyCollectionBase
    {

        #region Data Structure
        [Serializable]
        public struct FixedBillingPackageListInfo
        {
            // This has private members, public properties because
            // ASP.NET can't data bind to public members of a structure
            private int _fixedBillingPackageID; //**PK
            private string _packageName;
            private decimal _rate;

            public int FixedBillingPackageID
            {
                get { return _fixedBillingPackageID; }
                set { _fixedBillingPackageID = value; }
            }

            public string PackageName
            {
                get { return _packageName; }
                set { _packageName = value; }
            }
            public decimal Rate
            {
                get { return _rate; }
                set { _rate = value; }
            }

            public string PackageNamePrice
            {
                get
                {
                    return String.Format("{0} ({1})", _packageName, _rate);
                }
            }
        }
        #endregion //Data Structure

       #region Data Access
        protected void Fetch(object criteria)
        {
            //retrieve data from database
            Criteria crit = (Criteria)criteria;
            Database database = DatabaseFactory.CreateDatabase("ConnectionString");
            DbCommand dbCommand = database.GetSqlStringCommand("SELECT FixedBillingPackage.FixedBillingPackageID AS FixedBillingPackageID, FixedBillingPackage.PackageName AS PackageName, FixedBillingPackage.Rate AS Rate FROM FixedBillingPackage ");
            dbCommand.CommandType = CommandType.Text;
            SafeDataReader dataReader = new SafeDataReader(database.ExecuteReader(dbCommand));
            try
            {
                // Insert Blank row at the top of the list if specified.
                if (crit.IncludeBlankRow)
                {
                    FixedBillingPackageListInfo info = new FixedBillingPackageListInfo();
                    info.FixedBillingPackageID = -1;
                    info.PackageName = String.Empty;
                    info.Rate = 0;
                    InnerList.Add(info);
                }

                while (dataReader.Read())
                {
                    FixedBillingPackageListInfo info = new FixedBillingPackageListInfo();
                    info.FixedBillingPackageID = dataReader.GetInt16(0);
                    info.PackageName = dataReader.GetString(1);
                    info.Rate = dataReader.GetDecimal(2);
                    InnerList.Add(info);
                }
            }
            finally
            {
                dataReader.Close();
                dataReader.Dispose();
            }
        }

        #endregion Data Access
    }

MainForm.cs
================
MainForm.cs
===============


public MainForm()
{
   InitializeComponent();
   INitializeData();
}

private void InitializeData()
{

            FixedBillingPackageList packageList = FixedBillingPackageList.GetFixedBillingPackageList(true);
            comboFixedBillingPackage.BindingContext = new BindingContext();
           
            this.comboFixedBillingPackage.DisplayMember = "PackageName";
            this.comboFixedBillingPackage.ValueMember = "FixedBillingPackageID";
            comboFixedBillingPackage.DataSource = packageList;
}
Victor
Telerik team
 answered on 11 Feb 2010
3 answers
194 views
Hi,
I'm getting into TPF based control development and I'm finding a lot of difficulties to understand the behind logic maybe because there is not enough documentation and examples on that.

I'm trying to make a control that arrange in a stacklayout many radlabelelement as the Rows property value of my control; the height of any child element should be control.Size.Height/control.Rows, so I got my child to have same height.

This is the way I implement it, could you please help me on that?

MyControl:
    public class MyControl : RadControl 
    { 
        MyElementPanel elementPanel; 
 
        public MyControl() 
        { 
            this.UseNewLayoutSystem = true; 
            this.AutoSize = true; 
        } 
 
        protected override void CreateChildItems(RadElement parent) 
        { 
            elementPanel = new MyElementPanel(); 
            this.RootElement.Children.Add(elementPanel); 
            base.CreateChildItems(parent); 
        } 
 
        public int Rows 
        { 
            get 
            { 
                return this.elementPanel.Rows; 
            } 
            set 
            { 
                this.elementPanel.Rows = value; 
            } 
        } 
 
    } 
 

MyElement:
    public class MyElementPanel : RadItem 
    { 
        StackLayoutPanel layout; 
 
        public static RadProperty RowsProperty = RadProperty.Register( 
            "Rows", 
            typeof(int), 
            typeof(MyElementPanel), 
            new RadElementPropertyMetadata(2, ElementPropertyOptions.AffectsLayout)); 
 
        public int Rows 
        { 
            get 
            { 
                return (int)this.GetValue(RowsProperty); 
            } 
            set 
            { 
                this.SetValue(RowsProperty, value); 
            } 
        } 
 
        protected override void CreateChildElements() 
        { 
            var border = new BorderPrimitive(); 
            Children.Add(border); 
            var background = new FillPrimitive(); 
            Children.Add(background); 
 
            layout = new StackLayoutPanel(); 
            layout.Orientation = System.Windows.Forms.Orientation.Vertical; 
            this.Children.Add(layout); 
 
            var rows = this.Rows; 
            int rowHeight = (int)this.Size.Height / rows; 
            for (int i = 0; i < rows; i++) 
            { 
                var child = new RadLabelElement(); 
                child.Text = (i + 1).ToString(); 
                child.Margin = new System.Windows.Forms.Padding(1); 
                child.Children[2].AutoSize = false; 
                child.Children[2].Size = new Size(20, rowHeight); 
                child.BorderVisible = true; 
                layout.Children.Add(child); 
            } 
 
            base.CreateChildElements(); 
        } 
 
        protected override void OnPropertyChanged(RadPropertyChangedEventArgs e) 
        { 
            if (e.Property == StorageRackElement.RowsProperty) 
            { 
                var rows = (int)e.NewValue; 
                int rowHeight = (int)this.Size.Height / rows; 
                layout.Children.Clear(); 
                for (int i = 0; i < rows; i++) 
                { 
                    var child = new RadLabelElement(); 
                    child.Text = (i + 1).ToString(); 
                    child.Margin = new System.Windows.Forms.Padding(1); 
                    child.Children[2].AutoSize = false; 
                    child.Children[2].Size = new Size(20, rowHeight); 
                    child.BorderVisible = true; 
                    layout.Children.Add(child); 
                } 
            } 
            if (e.Property == StorageRackElement.BoundsProperty) 
            { 
                int rowHeight = (int)this.Size.Height / this.Rows; 
                foreach(var child in layout.Children) 
                    child.Children[2].Size = new Size(20, rowHeight); 
            } 
 
            base.OnPropertyChanged(e); 
        } 
    } 
 
Dobry Zranchev
Telerik team
 answered on 11 Feb 2010
0 answers
198 views
i created a radribbonform as a main form for my application. then i added 2 radform as mdichild of the main. i load the windowstate of the 2 mdichild to maximize. While 2 mdichild is open, i used a button to toggle between the 2. problem is, the windowstate of the child revert back to normal state.  i want the radform to show in maximize state. how can i fixed this? anyone?

Thanks,
jeff torririt
Top achievements
Rank 1
 asked on 11 Feb 2010
3 answers
216 views
i have  radgridview with a datasource of type bindingsource that is linking to a linq2sql class.

when i insert a new record i want call a method to refresh the grid.
Im inserting from a detail view, not from the grid.

 have tried with  refrsh method in the bindingsourc, and with an update in the grid but nothing happens.
Martin Vasilev
Telerik team
 answered on 10 Feb 2010
5 answers
302 views

Hi
I have an unbound radgridview and I am deleteing the row with an ID value of 0 the code runs but the row is still visible in the grid and when the radgridview is selected I get an error:

 

System.Data.RowNotInTableException was unhandled

  Message="This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row."

  Source="System.Data"

 

 

For x As Integer = 0 To Me. radgridview1.Rows.Count - 1

                    If (Me. radgridview1.Rows(x).Cells("ID").Value) = 0 Then

                        Me.Packagelist.Rows.RemoveAt(x)                       

                        Exit For

                    End If

                Next

How do I remove the row from the grid and avoid the error?
Regards
Joe

Nikolay
Telerik team
 answered on 10 Feb 2010
12 answers
299 views
I have 2009Q3  installed with VS 2008.
I installed VS 2010 Beta 2

The Win Rad Win Controls tab does not show up ( I added the tab and controls)
The Open Access menu is presents
The Telerik Report menu is not present

If I add a Radtextbox and run I get the following error:
Error 8 Type 'Telerik.WinControls.UI.RadTextBox' is not defined. 

Is there a previous message or paper that explains how to user Telerik products with VS 2010?
Nick
Telerik team
 answered on 10 Feb 2010
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
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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?