Telerik Forums
UI for WinForms Forum
1 answer
99 views
We recently upgraded our WinForms controls from Q2 2011 to Q1 2013 and now have an issue when opening many of the windows forms. The Error is: Unable to cast object of type ‘Telerik.WinControls.UI.RadButton’ to type ‘Telerik.WinControls.RadControl’. Does anyone have any information on what could be causing this error? Thank you for your help.
Bonnie
Top achievements
Rank 1
 answered on 07 May 2013
3 answers
125 views
I can't seem to get the vertical scrollbar to work in monthview. I can make it visible, but it doesn't want to scroll the scheduler. Autoscroll doesn't seem to do it.

Any ideas?
Peter
Telerik team
 answered on 07 May 2013
3 answers
122 views
Hi,
is there a way to make the right header in the RadPrintDocument right aligned so if i have mixed language text (hebrew and english in my case) It will show it right...

currently i use this function (partly taken from this site - c-sharp-split-and-revers-sentence-with-two-languages):
public static string ProcessEnglishHebrewSentence(string sentence)
        {
            var ret = new List<string>();
            string[] words = sentence.Split(' ');
 
            var curHebrewList = new List<string>();
            var curEnglishList = new List<string>();
            bool curLangIsHebrew = false;
            string w;
            string reversed;
 
            for (int i = words.Length; i > 0; i--)
            {
                w = words[i - 1];
                if (System.Text.RegularExpressions.Regex.IsMatch(w, @"\p{IsHebrew}") && curLangIsHebrew) // we have a word in Hebrew and the last word was in Hebrew too
                {
                    curHebrewList.Add(w);
                }
                else if (System.Text.RegularExpressions.Regex.IsMatch(w, @"\p{IsHebrew}") && !curLangIsHebrew) // we have a word in Hebrew and the last word was in English
                {
                    if (curEnglishList.Any())
                    {
                        curEnglishList.Reverse();
                        ret.AddRange(curEnglishList);
                    } // reverse current list of English words and add to List
                    curEnglishList = new List<string>(); // create a new empty list for the next series of English words
                    curHebrewList.Add(w);
                    curLangIsHebrew = true; // set current language to Hebrew
                }
                else if (!System.Text.RegularExpressions.Regex.IsMatch(w, @"\p{IsHebrew}") && !curLangIsHebrew) // we have a word in English and the last word was in English
                {
                    if (System.Text.RegularExpressions.Regex.IsMatch(w, @"[a-zA-Z]"))
                    {
                        reversed = new string(w.Reverse().ToArray());
                        reversed = reversed.Replace("(", "^");
                        reversed = reversed.Replace(")", "(");
                        reversed = reversed.Replace("^", ")");
                    }
                    else
                        reversed = w;
 
 
                    curEnglishList.Add(reversed); // reverse and add it to the current series of English words
                }
                else if (!System.Text.RegularExpressions.Regex.IsMatch(w, @"\p{IsHebrew}") && curLangIsHebrew) // we have a word in English and the last word was in Hebrew
                {
                    if (curHebrewList.Any())
                    {
                        curHebrewList.Reverse();
                        ret.AddRange(curHebrewList); // add current list of Hebrew words to List of Lists
                    }
                    curHebrewList = new List<string>(); // create a new empty list for the next series of Hebrew words
 
                    if (System.Text.RegularExpressions.Regex.IsMatch(w, @"[a-zA-Z]"))
                    {
                        reversed = new string(w.Reverse().ToArray());
                        reversed = reversed.Replace("(", "^");
                        reversed = reversed.Replace(")", "(");
                        reversed = reversed.Replace("^", ")");
                    }
                    else
                        reversed = w;
 
                    curEnglishList.Add(reversed);
                    curLangIsHebrew = false; // set current language to English
                }
                else
                {
                    throw new Exception("there should be no other case...");
                }
            }
            if (curHebrewList.Any())
            {
                curHebrewList.Reverse();
                ret.AddRange(curHebrewList);
            }
            if (curEnglishList.Any())
            {
                curEnglishList.Reverse();
                ret.AddRange(curEnglishList);
            }
 
            return ret.Aggregate((a, b) => a + " " + b);
        }

I would like to know if there is a more elegant sollution
Ivan Petrov
Telerik team
 answered on 07 May 2013
3 answers
253 views

Helo !

I used RadTextBoxControl in winforms.(win7, .net4.0)
I used this control to search records (Text box to search records with autocomplete feature).

Now, i want my autocomplete to be similar as of google search box works.
like, the moment i started typing text in the textboxcontrol the first matching record should appear as watermark, instead of highlighted and selected.This autocomplete records being pulled from database.

While typing the text in radtextboxcontrol, the matching characters should be highlighted with bold fonts and the rest characters from matching records should be watermarked. Contents being displayed in dropdown should be inversely formatted with respect to contents in textbox(e.g. matching characters should be watermarked and rest should be bold)

For illustration of my problem you may have look on google searchtextbox.

Looking ahead for your response.

Thanks,
Arpus

Stefan
Telerik team
 answered on 07 May 2013
1 answer
118 views
Is there a way to use the default "pushpin" icons pictured in the documentation for RadToggleButton?
Will
Top achievements
Rank 1
 answered on 06 May 2013
1 answer
413 views
How would I change the font size of my RadGridView, but keep the default font size of the header row - column headers?
Paul
Telerik team
 answered on 06 May 2013
1 answer
117 views
First of all let me apologize for what is probably a easy to answer question. I am unsure of what I need to do for the next step in getting the update to fire and get posted to the SQL DB. This is about the last thing I need to do to have this app finished. I have all the other code needed done. 

I have the radgridview1 already being filled by a dataset. How or rather what is the best way to get the updates posted to the db? I have done my app in C#. In this grid I am forcing the user to do a cell selection to make each change in the row.

Any help you could offer would be greatly appreciated. 

Tom
Peter
Telerik team
 answered on 06 May 2013
11 answers
508 views
Hi !
I have used a dropdownlist in the Gridview column's header for selecting column name. I have created a custom dropdownlist in creating a header cell class which I am using at GridView Column's Header. I am getting problem when I am selecting any value in dropdownlist and when I am moving scroll bar of gridview then its value getting reset automatically. I want to select column name from dropdownlist in header cell. Kindly, find the code I am using and Images related to problem.

public class MyHeaderCellElement : GridHeaderCellElement
   {
       GridViewColumn _col;
     public MyHeaderCellElement(GridViewColumn col, GridRowElement row)
           : base(col, row)
       {
           _col = col;
          this.TextAlignment = ContentAlignment.TopCenter;
       }
       RadDropDownListElement dropDownListElement1;
       RadCheckBoxElement checkBox1 = new RadCheckBoxElement();
 
       protected override void CreateChildElements()
       {
           base.CreateChildElements();
           if (dropDownListElement1 == null || dropDownListElement1.DataSource == null)
           {
               dropDownListElement1 = new RadDropDownListElement();
              checkBox1.StretchHorizontally = true;
               checkBox1.ToggleStateChanged += new StateChangedEventHandler(checkBox1_ToggleStateChanged);
               this.Children.Add(checkBox1);
               dropDownListElement1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
              List<string> lst = solusDataAccess.GetMasterFields(solusGeneric.strConnectionString).AsEnumerable().Select(x => x[0].ToString()).ToList();
               dropDownListElement1.DataSource = lst;
               dropDownListElement1.Margin = new Padding(15, 0, 0, 0);
               dropDownListElement1.StretchHorizontally = true;
               dropDownListElement1.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(dropDownListElement1_SelectedIndexChanged);
               this.Children.Add(dropDownListElement1);
           }        
       }
 
       void checkBox1_ToggleStateChanged(object sender, StateChangedEventArgs args)
       {
           if (solusGeneric.dicStrColumnFlag.ContainsKey(_col.Name))
               solusGeneric.dicStrColumnFlag.Remove(_col.Name);
           solusGeneric.dicStrColumnFlag.Add(_col.Name, checkBox1.Checked);
       }
 
            public override bool IsCompatible(GridViewColumn data, object context)
       {
           return data is GridViewTextBoxColumn && context is GridHeaderCellElement; ;
       }
 
       protected override Type ThemeEffectiveType
       {
           get
           {
               return typeof(GridHeaderCellElement);
           }  
       }
   }

Thanks and Regards
Achyut 
Stefan
Telerik team
 answered on 06 May 2013
1 answer
72 views
Hi,

I have a question.

Is it possible to insert a new row anywhere?

What if i want to insert new rows in the middle of the RadGridView?

In this attached file, editing row feature is always on top.

How can I handle with this?

Please help :D

Regards,
Eric
Stefan
Telerik team
 answered on 06 May 2013
1 answer
107 views
Hi,

if LoadFromXml fails, I am loading it from the defaultsetting.xml created during design time or copied from the file saved by raddock.
SaveToXml() method itself.

The problem I am having is that toolwindow does not behave correctly. I can't close it or float around etc. 

Code snippet:

 if (File.Exists(DockStatePath)) 
 {    
try { radDock.LoadFromXml(DockStatePath);        
}     
catch (XmlException)    

radDock.LoadFromXml("defaulsetting.xml");

}

Thx in advance
Stefan
Telerik team
 answered on 06 May 2013
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?