Telerik Forums
UI for WinForms Forum
1 answer
94 views

Hello, 

I'm currently building a material library tool using Telerik's RadListView. I pretty much got it near exactly what I'm after. However, I'm having some trouble with the last feature, and I'm hoping someone can provide some insight.

What I'd like to do is add an icon to the top left-hand corner of each item that will represent their category.

So far, using the following code and a bit of trickery with HTML markup, my ListView Items currently look like this.

(Written in C++)

    //Create a new ListView Item
    Item = gcnew ListViewDataItem();
    
    //Generate HTML Label
    String^ Label = "<html><strong>" + Name + "</strong><br><span style=\"color:f5f5f5\"><i>" + Latin + "</i></span></html>";
    Item->Text = Label;
    Item->TextAlignment = ContentAlignment::MiddleCenter;
    Item->TextImageRelation = Windows::Forms::TextImageRelation::ImageAboveText;

    //Load the Thumbnail
    String^ thumbnailPath = Path + "\\" + ThumbPath;
    Item->Image = Image::FromFile(thumbnailPath);
    Item->ImageAlignment = ContentAlignment::TopCenter;
   

However, what I'd like to achieve is this:

I was hoping there was a Background Image property for ListViewDataItem. However, that doesn't seem to be the case. Is there a clever trick to achieve this? Or is my only option to create a Custom ListViewDataItem as described here? https://docs.telerik.com/devtools/winforms/controls/listview/custom-items

Thanks!

Dinko | Tech Support Engineer
Telerik team
 answered on 21 Nov 2023
2 answers
49 views

 

The summary row at top and bottom should not scroll while horizontal scroll.

Nadya | Tech Support Engineer
Telerik team
 answered on 20 Nov 2023
1 answer
112 views

Hi,

 

I want to hide grid column but condition is,  summary row column should not be hidden.

I want to display summary column but not grid column.

Dinko | Tech Support Engineer
Telerik team
 answered on 17 Nov 2023
1 answer
68 views

Hi, I need to show a boolean column in a RadGridView.

I would like to show the column as in the attached image, i.e. with a tick for the true value and nothing for the false value.

I would like to use GridViewCheckBoxColumn but, this column always shows values as checkboxes. In my case, the table is readonly, so the standard checkboxed makes the user to think that he can click to change the check value.

I tried using a GridViewTextBoxColumn and using CellFormatting event:

 


private void radGrid_CellFormatting(object sender, CellFormattingEventArgs e)
{
      if (this.DesignMode) return;

			if (e.CellElement.ColumnInfo.FieldName == "ScambioPratiche") {
				if ((bool)((System.Data.DataRowView)e.CellElement.RowInfo.DataBoundItem).Row["ScambioPratiche"] == true)
				{
					e.CellElement.Image = MyApp.Main.Properties.Resources.tick;
				}
				else
				{
					e.CellElement.Image = null;
				}
				e.CellElement.Text = string.Empty;
			}
			else
			{
				e.CellElement.ResetValue(LightVisualElement.ImageProperty, ValueResetFlags.Local);
			}

		}

 

In this way, however, the filter is a text filter and not a checkboxfilter...
Is there a better way to gain my goal, possibly by GridViewCheckBoxColumn ?

Nadya | Tech Support Engineer
Telerik team
 answered on 17 Nov 2023
1 answer
55 views

Hi

I am playing with the RadRangeSelector. I have associated it to an existing chart. The chart is dynamically filled using data from the database.

In the image here below, the top control is a RadRangeSelector, the bottom control is a RadChartView.

Notice that my bottom chart shows series as stacked. How can I get the RadRangeSelector also showing stacked series?

Also notice that the dates are not inlined between top and bottom. How can the RadRangeSelector be sorted by dates (as my chart is showing)?

 

Nadya | Tech Support Engineer
Telerik team
 answered on 15 Nov 2023
1 answer
44 views

Hi,

I'm using Telerik for Winforms 2023.3.1010 on .NET 7.

While trying to configure the position of my label position using PieTwoLabelColumnsStrategy, only the first label seems to be working with DistanceBetweenLabels property.

 

 PieTwoLabelColumnsStrategy strategy = new PieTwoLabelColumnsStrategy()
 {
     DistanceBetweenLabels = 50,
     DistanceToLabel = -100
 };

 SmartLabelsController smartLabelsController = new SmartLabelsController
 {
     Strategy = strategy
 };

 radChartView.Controllers.Add(smartLabelsController);
 radChartView.ShowSmartLabels = true;

Here is how I'm filling the chart:


   radChartView.AreaType = ChartAreaType.Pie;
   radChartView.Series.Clear();

   DonutSeries donut = new DonutSeries
   {
       ShowLabels = true,
       LabelMode = PieLabelModes.Horizontal,
       DrawLinesToLabels = true,
       SyncLinesToLabelsColor = true,
       NumberOfColors = categoryCount
   };

   foreach (var v in totals.OrderByDescending(s => s.Statut))
   {
       PieDataPoint point = new PieDataPoint(v.Nombre, v.Statut)
       {
           Label = $"{v.Percentage}% {v.Statut}"
       };

       donut.DataPoints.Add(point);
   }

   radChartView.Series.Add(donut);
   radChartView.Area.View.Palette = KnownPalette.Metro;
   radChartView.SelectionMode = ChartSelectionMode.SingleDataPoint;
   radChartView.BackColor = Color.WhiteSmoke;

With small percentages, it doesn't work (except of the right bottom label)

With higher percentages it seems to be working :

The behavior is quite inconsistent.

Thank you for your help.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Nov 2023
1 answer
68 views

Hello,

In my gridview, I have a  progressBarElement in a grid column as explained here:

https://docs.telerik.com/devtools/winforms/controls/gridview/cells/creating-custom-cells?_gl=1*d7lc04*_gcl_au*MTgwMTc5NzcyMS4xNjk5NTI4NjIw*_ga*OTQ3ODE2NTUuMTY5MTU3MzE4Nw..*_ga_9JSNBCSF54*MTY5OTUyODYyMC4xNS4xLjE2OTk1MzMwODcuMzUuMC4w&_ga=2.222397211.1249884809.1699528621-94781655.1691573187

When I export, I don't have the progress bar, only values



 private void RunExportToExcelML(string fileName, ref bool openExportFile)
        {
            ExportToExcelML excelExporter = new ExportToExcelML(this.radGridView1)
            {
                SheetName = "Essai",
                SummariesExportOption = SummariesOption.ExportAll,
                SheetMaxRows = ExcelMaxRows._65536,
                ExportVisualSettings =true,
                
                
                
            };

            try
            {
                excelExporter.RunExport(fileName);

                RadMessageBox.SetThemeName(this.radGridView1.ThemeName);
                DialogResult dr = RadMessageBox.Show("The data in the grid was exported successfully. Do you want to open the file?",
                    "Export to Excel", MessageBoxButtons.YesNo, RadMessageIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    openExportFile = true;
                }
            }
            catch (IOException ex)
            {
                RadMessageBox.SetThemeName(this.radGridView1.ThemeName);
                RadMessageBox.Show(this, ex.Message, "I/O Error", MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Nov 2023
1 answer
69 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
3 answers
54 views

Probably more of a suggestion than a question.

I would like an FileExportMode that is between the 2 existing modes. It creates or overrides the named Sheet in the given XLSX

User could then:

  • Export to a named sheet.
  • Add another sheet that references the exorted data
  • Run the Export again to refresh the data
Nadya | Tech Support Engineer
Telerik team
 answered on 10 Nov 2023
1 answer
55 views

I have grid with hierarchy gridviewtemplate.  Is there a way to paginate the child  like the master template?

thanks

Nadya | Tech Support Engineer
Telerik team
 answered on 10 Nov 2023
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?