Telerik Forums
UI for WinForms Forum
2 answers
299 views

Dear all,

I am having difficulties to fix the column size in a ListView in Detail mode.

My set up code is very simple and as follow :

        private void SetLisViewProduitBase()
        {
            ListViewDetailColumn PBaseColumn;
            rlvProduitBase.ViewType = ListViewType.DetailsView;
            rlvProduitBase.AutoSizeColumnsMode = ListViewAutoSizeColumnsMode.None;
            rlvProduitBase.HeaderHeight = 18;
            rlvProduitBase.Font = new Font(rlvProduitBase.Font, FontStyle.Regular);

            rlvProduitBase.ShowCheckBoxes = true;
            rlvProduitBase.ThreeStateMode = false;

            PBaseColumn = new ListViewDetailColumn("Code");
            PBaseColumn.Width = 40;
            rlvProduitBase.Columns.Add(PBaseColumn);

            PBaseColumn = new ListViewDetailColumn("Forme");
            PBaseColumn.Width = 50;
            rlvProduitBase.Columns.Add(PBaseColumn);

            PBaseColumn = new ListViewDetailColumn("Nom Usuel");
            PBaseColumn.Width = 100;
            rlvProduitBase.Columns.Add(PBaseColumn);

            PBaseColumn = new ListViewDetailColumn("Nom Botanique");
            PBaseColumn.Width = 100;
            rlvProduitBase.Columns.Add(PBaseColumn);

            PBaseColumn = new ListViewDetailColumn("Origine");
            PBaseColumn.Width = 70;
            rlvProduitBase.Columns.Add(PBaseColumn);

            PBaseColumn = new ListViewDetailColumn("Labels");
            PBaseColumn.Width = 70;
            rlvProduitBase.Columns.Add(PBaseColumn);
        }

While empty, the columns width are displaying fine as seen on image 1.

When I connect the Datasource (as in https://docs.telerik.com/devtools/winforms/controls/listview/populating-with-data/data-binding), all columns get the same "default" size.

As you say (in the Adding Columns doc) that using a datasource will require to set the column width within the ColumnCreating event, I have tried this.

When this event is first called after defining the columns as in the previous code, I get a NullReference exception as if the columns are not defined.

If I try to create the columns them within the event and test first for column existence, I will get a column already exist exception (An item with the same key already exist).

What am I doing wrong ?

Many thanks for your answers

Patrick


Patgat
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 11 May 2022
1 answer
171 views

Hello,

I'd like to translate parts of the date filter in the radgridview - see the pic (numbers 1, 2, 3 are in order of clicks to get to the specific filter settings).

Those red rectangles need to be translated. And the date format should be in a short form (like 11.05.2022).

How to do that? It seems it has to do something with a FilterPopupInitialized event but I don't know what to do there.

Thanks in advance.

Regards,

Tomáš

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 11 May 2022
1 answer
447 views

Hi

Is there a way to create a floating action button like this but in Telerik WinForms ?

Thank you.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 11 May 2022
1 answer
274 views

I have a RadPageView control in a RadForm. When I show the form, the first RadPageViewPage is scaling regarding DPI as expected. But when I select the second RadPageViewPage it is not scaled. When I move the form to another screen and back, it is scaled as expected. The RadPageViewPAge contains a UserControl with another RadPageView control.

As expected:

Too small:

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 May 2022
1 answer
153 views

Hi there

 

I have a column in my DataTable that is called "checked"

I want to make this a checkbox.

With this code it is not changing it:

                GridViewCheckBoxColumn checkboxcolumn = new GridViewCheckBoxColumn();
                checkboxcolumn.DataType = typeof(int);
                checkboxcolumn.Name = "checked";
                checkboxcolumn.FieldName = "checked";
                checkboxcolumn.HeaderText = "Checked?";
                this.grdIssueAcceptance.MasterTemplate.Columns.Add(checkboxcolumn);

With this it added the type nicely, but it is another field. I do not want to ADD a field. 

                GridViewCheckBoxColumn checkboxcolumn = new GridViewCheckBoxColumn();
                checkboxcolumn.DataType = typeof(int);
                checkboxcolumn.Name = "checked02";
                checkboxcolumn.FieldName = "checked02";
                checkboxcolumn.HeaderText = "Checked?";
                this.grdIssueAcceptance.MasterTemplate.Columns.Add(checkboxcolumn);

 

Regards

Kobus

Dinko | Tech Support Engineer
Telerik team
 answered on 10 May 2022
1 answer
185 views

Hello Guys,

we are trying to use the Nuget to install the telerik controls instead of local installation, but I found under the winFrom project, it doesn't work, I try to search "Telerik.WinControls.ChartView",  but no expected results return, my telerik Nuget settings is like below:

 

 

I don't think the ".Telerik.Windows.ChartView" is what we want.

the only thing for winforms controls is named "TelerikWinCompositeUI", when I installed it,

 

I found the "Telerik.WinControls.ChartView" doesn't exist.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 May 2022
2 answers
188 views

Hi,

Is it possible to get an example of how to to create a custom TextHighlightTag? To try and recreate what the 'Find All' achieves in the search dialog.

It's the only TaggerBase I'm having trouble getting working. I've literally copied the source code from TextSearchHighlightTagger.cs but no matter what when I try to use UpdateSearchWord it results in an exception 'Object reference not set to an instance of an object.'

If I don't register a custom tagger and just use:

syntaxEditor1.SyntaxEditorElement.HighlightAllMatches("Test");

It does exactly what I want to do, only that I can't seem to set the TextFormatDefinition.

What I'm hoping to achieve is to have a text field that controls what is highlighted. Custom would be ideal as I could have more than one then but for my intended purpose I'd be happy just to be able to configure the default colors.

Thanks in advanced!

Regards

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 May 2022
2 answers
119 views

I am using a default RadListView control, and wish to use custom list items. Following the directions here, I wrote the following class.

using System;
using System.Drawing;
using Telerik.WinControls.UI;
using Telerik.WinControls.Layouts;

namespace CustomListItemTest
{
    class SampleVisualItem : SimpleListViewVisualItem
    {
        private LightVisualElement sampleNumberField;
        private StackLayoutPanel stackPanel;

        public string sampleNumber = string.Empty;

        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            stackPanel = new StackLayoutPanel
            {
                Orientation = System.Windows.Forms.Orientation.Horizontal,
                EqualChildrenWidth = true,
                ShouldHandleMouseInput = false,
                NotifyParentOnMouseInput = true
            };

            sampleNumberField = new LightVisualElement
            {
                StretchHorizontally = true,
                MinSize = new Size(50, 0),                
                ShouldHandleMouseInput = false,
                NotifyParentOnMouseInput = true                
            };
            stackPanel.Children.Add(sampleNumberField);

            Children.Add(stackPanel);
        }

        protected override void SynchronizeProperties()
        {
            base.SynchronizeProperties();

            Text = "";            
            sampleNumberField.Text = sampleNumber;
        }

        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(SimpleListViewVisualItem);
            }

        }
    }
}

 

On the form I handle these events.

private void RadForm1_Load(object sender, EventArgs e)
        {
            ListViewDataItem newItem = new ListViewDataItem();
            newItem.Key = "sampleNumber";
            newItem.Value = "123434";
            SampleList.Items.Add(newItem);
        }

        private void SampleList_VisualItemCreating(object sender, ListViewVisualItemCreatingEventArgs e)
        {
            if (SampleList.ViewType == ListViewType.ListView)
            {
                e.VisualItem = new SampleVisualItem();
            }
        }

 

However the added item does not appear. If I click around enough and move the mouse off screen, the item does appear (so it does exist), but if I click off-screen again it's gone.

What am I doing wrong?

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 May 2022
1 answer
81 views

I've searched and found a few suggestions on how to do this, but none of them seem to work for me.  

Here's what I've tried in the CellFormatting event:

        e.CellElement.DrawBorder = False
        e.CellElement.BorderWidth = 0
        e.CellElement.BorderBottomWidth = 0
        e.CellElement.BorderTopWidth = 0
        e.CellElement.BorderLeftWidth = 0
        e.CellElement.BorderRightWidth = 0

and I'm still seeing a horizontal line between rows:

Clearly I'm not doing the right thing, can someone please point me in the right direction?  

Thanks!

 

Dinko | Tech Support Engineer
Telerik team
 answered on 09 May 2022
2 answers
298 views
after the data source for the grid is being updated the columns adjusts them widths perfectly by using "BestFitColumns(BestFitColumnMode.DisplayedCells)" ,but what i wan to acheive next is to resize the hole grid based on the new size of the columns , i have set the autosize property to true and also tried AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill but that stops the columns to adjust based on the text inside , can't i adjust both together columns and hole grid width ?? 
Dinko | Tech Support Engineer
Telerik team
 answered on 09 May 2022
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
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
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
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
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?