Telerik Forums
UI for WinForms Forum
1 answer
170 views

.NET Framework 4.8

Telerik 2022 R1 

 

There are two conditional cell formats: one for the command cell and another for a checkbox. 

The formatting for the command cell works without issue.  However, for the unavailable column the formatting is applied to other cells and even other columns regardless of the value which is needed. 

Only the first two rows, "1 Giant Slice" and "10inch Small", should have the unavailable cells in red.  These two rows are consistently formatted correctly, but other rows have both unavailable and available cells formatted in red, too.  The rows which have incorrect formatted do not seem to be consistent. 

The debugger and logging the values of the data bound item shows that the proper values are there and only.

e.g.

only the two items and for the proper column are processed by the if statement that applies formatting to the unavailable cell (line 134 in form).
2022-09-01 10:26:08.749  [DEBUG]  Item: 1 Giant Slice  -  Next Available: [01/01/2024 12:30:00]  -  Column Name: Unavailable
2022-09-01 10:26:08.761  [DEBUG]  Item: 10inch Small  -  Next Available: [01/01/2024 12:30:00]  -  Column Name: Unavailable

I've attached a sample project with some sample JSON data that is loaded when the Form Load event is handled. 

 

There has to be something I'm doing wrong but I just can't figure out what it is.

Any help would be most appreciated. TIA

 

Cell formatting event handler:


        private void Dgv_MenuItems_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            if (_isFiltering)
            {
                return;
            }
            
            if (sender is GridCommandCellElement cellElement)
            {
                var row = dgv_MenuItems.Rows[e.RowIndex];
                var boundObj = (MenuItemAvailabilityModel)row.DataBoundItem;

                //This conditional formatting works without issue
                if (boundObj.CustomAvailability.Count > 0)
                {
                    cellElement.CommandButton.Text = "Change";
                    cellElement.CommandButton.ButtonFillElement.BackColor = Color.LightGreen;
                }
                else
                {
                    cellElement.CommandButton.Text = "Add";
                    cellElement.CommandButton.ButtonFillElement.BackColor = default;
                }
            }
            else if (e.Column.Name == nameof(MenuItemAvailabilityModel.Unavailable))
            {
                var row = dgv_MenuItems.Rows[e.RowIndex];
                var boundObj = (MenuItemAvailabilityModel)row.DataBoundItem;

                //This conditional formatting is applied to cells for which no NextAvailable is set in the data
                if (boundObj.NextAvailableAt.HasValue && boundObj.NextAvailableAt.Value > DateTime.Now)
                {
                    e.CellElement.DrawFill = true;
                    e.CellElement.BackColor = Color.Red;
                    e.CellElement.NumberOfColors = 1;
                }
            }
        }

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

Dear support,

I have a naive question regarding dropdown menu.

I have created a standard Rad MenuBar with four standard menuItems. Some of these menu items will contains multiple sub-menu items and I would like to automatically have a dropdown behaviour when the user pass the mouse hover the corresponding parent menu item.

Is this possible and how ?

Many thanks

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Aug 2022
1 answer
170 views

Hi,

I have chartview and radRangeSelector.

The question is: how can I get the Axis label values for from radRangeSelector for the start and end zoom.

Hope I can get help soon.

/Omar

Maria
Telerik team
 answered on 30 Aug 2022
3 answers
307 views
How to create dynamic report from Radgridview and how to customize the column width dynamically in report viewer?
Dimitar
Telerik team
 answered on 30 Aug 2022
1 answer
149 views

Hi,

I created an appointment in a multiDayView. I have no problem if the appointment duration is within the same day. However, if I span the appointment across two days, the appointment disappeared after I choose dayView or weekView and then move back to multiView. Below is the code snippet of my multiDayView routine. Any help is appreciated. Thanks

            SchedulerMultiDayView multiDayView = new SchedulerMultiDayView();
            this.radScheduler1.ActiveViewType = SchedulerViewType.MultiDay;            
            DateTime current = radCalendar1.SelectedDate;
            this.radScheduler1.ActiveView = multiDayView;
            multiDayView.Intervals.Add(current, 3);       
            multiDayView.ShowAllDayArea = false;

                      
Dinko | Tech Support Engineer
Telerik team
 answered on 30 Aug 2022
1 answer
270 views

Hello community!!!

I have a RadLabel with HTML-like formatting text and TextWarp property to true.

My_radLabel.Text = "<html>This is a text <b>example</b> this is a text <b>example</b> this is a text <b>example</b> this is a text <b>example</b>.";
My problem is when RadLabel text is warping. In any point of text where the </b> tag exists, if text warps there, next line has a space at the start like this:

This is a text example this is a text example
  this is a text example this is a text example.


Else, if I remove the <b> tag where the text is warping it looks okay:
My_radLabel.Text = "<html>This is a text <b>example</b> this is a text example this is a text <b>example</b> this is a text <b>example</b>.";
This is a text example this is a text example
this is a text example this is a text example.

Any idea why is this happening?

Thank you for your time!!!
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Aug 2022
2 answers
438 views

Is there a way to export from the gridview and freeze the top row?

Thanks,

Dimitar
Telerik team
 answered on 29 Aug 2022
1 answer
179 views

I have my text boxes all set to use rounded corners via the style builder.  However when I set the background color of a textbox, the background fill does not respect the rounded corners.  Below is a blown up screenshot as an example.

Dinko | Tech Support Engineer
Telerik team
 answered on 26 Aug 2022
2 answers
165 views

Hello,

I haven't seen this in the demos or documentation (yet?). is it possible to build a third calculated field out of two calculated fields?

Example: CalculatedField1 = Field1 + Field2

CalculatedField2 = Field3 + Field4

CalculatedField3 = calculatedField1 / calculatedField2

thanks in advance

Rolf Kaleveld

Dinko | Tech Support Engineer
Telerik team
 answered on 24 Aug 2022
1 answer
351 views

I have an application I'm upgrading from an old control set where this worked before.

The requirement that I have is that for each row, when a value is entered in the first column, I need to filter down the available items in a second combobox column on that row.  This changes row per row depending on what was entered in the first column.  

eg: If I enter "colour" in the first column, I need to see colours in the combobox. If I enter "shape" in the first column, I need to see shapes, in the combobox.

It's functionally working right now by just setting the datasource for the combobox to be a DataTables DefaultView that I'm just adjusting the row filter for.

//Set datasource
combo.DataSource = dt.DefaultView;

//Later on update filter to change values
dt.DefaultView.RowFilter = "some_id_column = " + id_to_filter_by;

But, every time I select a different row that doesn't match the filter pattern, the second column looks blank as the RowFilter changes.  The value is retained as part of the backing grid datasource, but it clumsy as the display text can look blank on any unselected rows.

Is there any way around this by changing the filter or data source directly on the cells instead of the column?  That way I could adjust it for each row without it effecting all rows?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Aug 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
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
WaitingBar
GroupBox
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
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
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?