Telerik Forums
UI for WinForms Forum
1 answer
38 views

I must be missing something obvious here. Given the class below:

    public class ContractForRefinance
    {
        public int ContrID { get; set; }
        public string ContrNumber { get; set; }
        public string LoanClass { get; set; }
        public DateTime LoanDate { get; set; }
        public decimal Balance { get; set; }
    }

I'm trying to set up a multi-column listbox with headers like this:

ListViewDetailColumn contrIDColumn = new ListViewDetailColumn("ContrID");
contrIDColumn.Width = 150;
contrIDColumn.HeaderText = "ContrID";
lstContractForRefinance.Columns.Add(contrIDColumn);

ListViewDetailColumn contrNumberColumn = new ListViewDetailColumn("ContrNumber");
contrNumberColumn.HeaderText = "ContrNumber";
contrNumberColumn.Width = 100;
lstContractForRefinance.Columns.Add(contrNumberColumn);

ListViewDetailColumn loanClassColumn = new ListViewDetailColumn("LoanClass");
loanClassColumn.HeaderText = "Description";
loanClassColumn.Width = 100;
lstContractForRefinance.Columns.Add(loanClassColumn);

ListViewDetailColumn loanDateColumn = new ListViewDetailColumn("LoanDate");
loanDateColumn.HeaderText = "LoanDate";
loanDateColumn.Width = 100;
lstContractForRefinance.Columns.Add(loanDateColumn);

ListViewDetailColumn balanceColumn = new ListViewDetailColumn("Balance");
balanceColumn.HeaderText = "Balance";
balanceColumn.Width = 100;
lstContractForRefinance.Columns.Add(balanceColumn);

lstContractForRefinance.ShowColumnHeaders = true;
lstContractForRefinance.ShowCheckBoxes = true;

foreach (var item in applicationManager.ContractForRefinanceList)
{
    lstContractForRefinance.Items.Add(item);
}

However, the control looks like this:

What am I missing?

Thanks

Carl

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Nov 2023
1 answer
89 views

Hello,

I have followed the tutorials and I was able to add a CustomCell made of a RadColorBox, this is working perfectly fine as long as the number of columns in the ListBox does not cause the horizontal scroll bar to appear. When this happens, and the user scrolls to show the other columns, the RadColorBox disappears initially and, by debugging what's happening, I see that it's "changing" the cell looping between all the columns in the rows.

This is the starting state

This is what happens when I scroll right untill the first column goes out of view then back in starting position

This is what happens if i keep scrolling left and right, the ColorBox is in the last column

If I keep scrolling left and right

Please note that this "scrolling" ColorBox is possible only because I have commented a line in the custom control

        public override bool IsCompatible(ListViewDetailColumn data, object context)
        {
            //if (data.Name != "Colore")
            //{
            //    return false;
            //}
            return base.IsCompatible(data, context);
        }

If I uncomment the name check, the ColorBox disappears until I have scrolled left and right enough times to allow it to go back to the first column, by debugging the data.Name value I see that it's "moving" from one column to another

This is the Creating event and I am adding the custom cell only if the cell is "Colore", exactly like in the examples, can anyone help me fix this strange behaviour?

        private void listEventi_CellCreating(object sender, Telerik.WinControls.UI.ListViewCellElementCreatingEventArgs e)
        {
            DetailListViewDataCellElement cell = e.CellElement as DetailListViewDataCellElement;
            if (cell != null && cell.Data.Name == "Colore")
            {
                var newCell = new CustomDetailListViewDataCellElement(cell.RowElement, e.CellElement.Data);
                newCell.FormParent = this;
                e.CellElement = newCell;
            }
        }

Thank you in advance for any suggestion

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Feb 2023
1 answer
75 views

In our application, we were using the standard windows CheckBox.

We have an Overrides onkeypress to trap the ENTER key and send a TAB (so enter moves to the next field on the form). This works great, and for the user to toggle a checked/non-checked state, the space bar is hit.

When using the RadCheckBox, the space bar still changes the checked state, but also when i hit ENTER, it changes the checked state and moves to the next field. 

I do not want it to change the checked state on the ENTER, i only want it to move to the next field.

Thanks.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Mar 2022
1 answer
78 views

the gap between checkboxes and their labels should be increase

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Mar 2022
1 answer
910 views

Very simple problem. 

How to get a CLB with only one item ever checked? There's a simple property to allow only single-select, but not one for 'only allow one box to be checked at a time'

How to do this, from inside the 'ItemCheckedChanged' event handler, without causing a stack overflow, as the previously cheked items are un-checked?

I feel this must be really easy - am I just missing something?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 Feb 2022
2 answers
244 views

hi

Why do I want to uncheck all the form checkboxes, but the regular checkbox is done ?!

 

 

my code is

void ClearForm(GroupBox control)
        {
               
            
                foreach (Control chexkBox in control.Controls)
                {
                    if (chexkBox is CheckBox)
                    {
                        ((CheckBox)chexkBox).Checked = false;

                    }


                }

                foreach (Control textBox in control.Controls)
                {
                if (textBox.GetType() == typeof(TextBox))
                    {
                        ((TextBox)textBox).Text = "no";

                    }

                }
            

           


        }
Dinko | Tech Support Engineer
Telerik team
 answered on 25 Nov 2021
1 answer
105 views

SOLVED:  InitializeComponent() wasn't being called. Thought this was automatic?

I would have deleted this post, but there is no option.

 

I dragged the RadCheckedListBox to the form. But when I try to add data to the Item property, I get an exception because the control is null. I thought that like other controls, the RadCheckedListBox methods and properties could be accessed without having to be instantiated first. The instantiation is in Private Sub InitializeComponent() :

Me.cklstSuppressedTickets = New Telerik.WinControls.UI.RadCheckedListBox()
CType(Me.cklstSuppressedTickets,System.ComponentModel.ISupportInitialize).BeginInit
Me.grpSuppressedTickets.Controls.Add(Me.cklstSuppressedTickets)
Me.cklstSuppressedTickets.Columns.AddRange(New Telerik.WinControls.UI.ListViewDetailColumn() {ListViewDetailColumn1})
Me.cklstSuppressedTickets.Location = New System.Drawing.Point(78, 61)
Me.cklstSuppressedTickets.Name = "cklstSuppressedTickets"
Me.cklstSuppressedTickets.Size = New System.Drawing.Size(290, 357)
Me.cklstSuppressedTickets.TabIndex = 0

 

cklstSuppressedTickets is the RadCheckedListBox that I added to the form using the designer. When I highlight the control in code during debug, it shows cklstSuppressedTickets as 'Nothing'.

	Private Sub LoadList()
		Dim tkt As KeyValuePair(Of String, string)
		For each tkt In dctTickets
			cklstSuppressedTickets.Items.Add(tkt.Key & "  -  " & tkt.Value)
		Next
	End Sub

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 15 Jul 2021
4 answers
190 views

I have a CheckedListBox with 3 columns.

But, I can't figure out how to set the width of each column even though I have used the code shown below;

    Private Sub BuildListBoxColumns()
        Dim nameColumn As New ListViewDetailColumn("Line Item Description")
        nameColumn.HeaderText = "Line Item Description"
        nameColumn.MinWidth = 800
        nameColumn.Width = 800
        Me.lbInvoiceItems.Columns.Add(nameColumn)
        Dim SKUColumn As New ListViewDetailColumn("SKU")
        SKUColumn.HeaderText = "SKU"
        SKUColumn.MinWidth = 120
        SKUColumn.Width = 120
        Me.lbInvoiceItems.Columns.Add(SKUColumn)
        Dim QtyColumn As New ListViewDetailColumn("Qty")
        QtyColumn.HeaderText = "Qty"
        QtyColumn.MinWidth = 80
        QtyColumn.Width = 100
        Me.lbInvoiceItems.Columns.Add(QtyColumn)
    End Sub

The MinWidth on each columns simply doesn't work.

How do I properly set the minwidth for each column?

it's probably something simple, but I cannot see why this isn't working

 

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 05 Apr 2021
2 answers
279 views

Hello Telerik,

How could I play with margin and padding to add some spacing between image, texte and certainly my checkboxe ?

Thank you in advance for your support !

Marco
Top achievements
Rank 2
Veteran
 answered on 12 Mar 2021
1 answer
144 views
Is there a way that you can order by the selected items in the CheckedList box?  So that when the dropdown list opens all the checked items are at the top.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Jan 2021
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
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
ContextMenu
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
DateTimePicker
CollapsiblePanel
Conversational UI, Chat
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
PictureBox
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?