Telerik Forums
UI for WinForms Forum
1 answer
259 views
Hello,

We are upgrading to the latest version of the WinForms components. I see there have been changes to the binding logic. I have a RadComboBox and I'm binding a list to it. If I create the combo dynamically and assign my list to the datasource property the Items collection is not bound (Items.Count = 0) until I assign the combo box to a container.

Is there a way to force this sooner without requiring a parent component? In this case our combo box is in a grid with an image associated with each item in the list so we are doing some initialization and need the items to be there for this.

Thanks,

-Gary

Here is some code to demonstrate the problem:
    public partial class Form1 : Form 
    { 
        const string DISPLAY_FIELD = "Name"
        const string VALUE_FIELD = "ID"
        public Form1() 
        { 
            InitializeComponent(); 
        } 
 
        private void radButton2_Click(object sender, EventArgs e) 
        { 
            List<ComboItems> comboItems = new List<ComboItems>(3); 
 
            comboItems.Add(new ComboItems("Red", 1)); 
            comboItems.Add(new ComboItems("White", 2)); 
            comboItems.Add(new ComboItems("Blue", 3)); 
 
            RadComboBox rcb = new RadComboBox(); 
            rcb.DisplayMember = DISPLAY_FIELD
            rcb.ValueMember = VALUE_FIELD
            rcb.DataSource = comboItems
 
            // rcb.Items.Count == 0 at this point 
            rcb.Parent = this
 
            // now rcb.Items.Count == 3  
        } 
    } 
 
    public class ComboItems 
    { 
        public string Name { get; set; } 
        public int ID { get; set; } 
 
        public ComboItems(string displayMember, int valueMember) 
        { 
            Name = displayMember
            ID = valueMember
        } 
 
    } 
 
Victor
Telerik team
 answered on 08 Dec 2009
3 answers
78 views
I am trying to make a multi row column that has two column header (groups) and 3 rows. In the first row, the first column has 2 columns under it and the second column has two columns as well. but in the third row the first column is blank (or atleast looks that way to the user), the second column has three columns where on column belongs to on parent and the other 2 belong to the other column

+------------------------------------+----------------------------------------------------+     
|               Name                 |                   Location                         |     
+----------------+-------------------+--------------------------------+-------------------+     
|     fname      |       lName       |           address 1            |    address 2      |
+----------------+-------------------+---------------+----------------+-------------------+     
|                |                   |     street    |      state     |     country       |
+----------------+-------------------+---------------+----------------+-------------------+    
 

Is there a parent child relationship I am missing to get the second row under it's respected parent or is it another GridViewColumnGroup 


view.ColumnGroups.Add(new GridViewColumnGroup("Name"));  
view.ColumnGroups.Add(new GridViewColumnGroup("Location"));  
    
view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());  
view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());  
view.ColumnGroups[0].Rows[0].Columns.Add(radGridView1.Columns["fname"]);  
view.ColumnGroups[0].Rows[0].Columns.Add(radGridView1.Columns["lName"]);  
              
view.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());  
view.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());  
view.ColumnGroups[1].Rows[0].Columns.Add(radGridView1.Columns["address 1"]); 
view.ColumnGroups[1].Rows[0].Columns.Add(radGridView1.Columns[
"address 2"]); 
view.ColumnGroups[1].Rows[1].Columns.Add(radGridView1.Columns["street"]);
view.ColumnGroups[1].Rows[1].Columns.Add(radGridView1.Columns["state"]); 
view.ColumnGroups[1].Rows[1].Columns.Add(radGridView1.Columns["country"]);  
 
Svett
Telerik team
 answered on 08 Dec 2009
1 answer
132 views
I want to show a window form named form2 on the other form named form1 and user can not select any control but the textbox on the
form1 until the form2 is closed....
Deyan
Telerik team
 answered on 08 Dec 2009
4 answers
302 views
Hello,

I have a few questions regarding the GridViewDateTimeColumn.

One, is there a way to set the range of dates that you can pick? Or perhaps a way to disable future dates?

Two, is there a way to create a TimePicker column?

Three, when editing an empty DateTime column it seems I have to make a selection, if i leave the selected date as it is (i.e. todays date) that date does not "stick" when I leave the column. The only way to select todays date it seems is to select another date first (using arrow keys) then today's date or to select the date in the actual date picker. Is there a way to make today's date "stick", if you will, without having to make an explicit selection?

Thank you
Johan
Jack
Telerik team
 answered on 08 Dec 2009
1 answer
121 views
When I'm moving a RadComboBox up / down in the Designer, no horizontal snap-to grid line pops up when the bottom of the text inside the TextBox portion of the Control aligns with the bottom of at least a Label or RadLabel Control or the text inside at least a TextBox or RadTextBox if not other controls as well.  The line only pops up when the bottom of the entire RadComboBox aligns with the above items.

Telerik WinForms 2009Q3 (2009.3.9.1103), VB, VS 2005 (v8.0.50727.762 SP.050727-7600), .Net 2.0 (2.0.50727), XP SP3, 3GB, 2.99GHZ, Core2Duo.



Victor
Telerik team
 answered on 08 Dec 2009
1 answer
108 views
the built-in windows forms listbox allows you to add items as objects, however the radlistbox forces you to add a listboxitem. why is that?

this is especially confusing because the SelectedItem property returns an object and NOT a RadItem.

I want to be able to add an object like I do for a regular listbox. can this be done?
Victor
Telerik team
 answered on 08 Dec 2009
1 answer
159 views
Trying to use the RadColorDialog with only the web tab showing to select Named colors.  Oddly after the "named" color is selected in the dialog, the SelectedColor is not a named color.  Pick Blue then see what happens.

            radColorDialog1.ColorDialogForm.ShowBasicColors = false
            radColorDialog1.ColorDialogForm.ShowProfessionalColors = false
            radColorDialog1.ColorDialogForm.ShowSystemColors = false
            radColorDialog1.ColorDialogForm.ShowHEXColorValue = false
            radColorDialog1.ColorDialogForm.AllowColorPickFromScreen = false
            radColorDialog1.ShowDialog(); 
 
            var color = radColorDialog1.SelectedColor; 
            var blue = Color.FromName("Blue"); 
            var areSame = color == blue ? "Same Color" : "Different Colors"; 
            var isKnown = color.IsKnownColor ? "Yes named" : "Not named"; 
            MessageBox.Show(string.Format("Color 1: {0} ({4})\nColor 2: {1} ({5})\n{2} : {3}", color, blue, areSame, isKnown, color.ToArgb(), blue.ToArgb())); 
 

Blue != Blue, Same ARGB != Same ARGB, Is not a named color.
Nikolay
Telerik team
 answered on 08 Dec 2009
2 answers
112 views
I was wondering if the grid view do a complex or statement between multiple columns.. I basically want the following statement.
var_1 = 1234
Show me all rows where (column_1 contains var_1 ) or (column_2 contains var_1 ) or (column_3 contains var_1 ) or (column_4 contains var_1 )

So I can have 1 field that searches multiple columns... can this be done with the radGridView or does it have to be done server side? Any sample code would be greatly appreciated.

Dev
Top achievements
Rank 1
 answered on 07 Dec 2009
5 answers
192 views
Good morning.
    I want to programmatically add a fixed height radListBox in the Form_Load. The height should be calculated accordingly to the number of items in the listbox. But the GetItemHeight method returns zero in the Form_Load. If I add a test button, and in the Click event perform the GetItemHeight, the result is 16, ok. Another problem is that I have to add 2 (magic number?) to the total height, otherwise the vertical scrollbar will appear. How can I solve these 2 problems?
 
Thank you
Victor
Telerik team
 answered on 07 Dec 2009
1 answer
166 views
Hi.... I am trying to modify the "FillPrimitive" values for a RadPanel using VB.Net Code.  I will admit that I am new to VB.Net and Telerik products.  I currently have installed the demo for WinForms Q3 2009 installed, and am currently going thu a tutorial posed here on this site that references the FormElement.ClientFillPrimitive for a form.  I read the release notes that said I should use a panel in the form to accomplish the same functionality.  I however have not been able to access the FillPrimitive properties for the Panel from code.  I can do so using the smart tag editor... but not from code.

Any help would be appreciated
Thank you
Nikolay
Telerik team
 answered on 07 Dec 2009
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
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
NavigationView
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?