Telerik Forums
UI for WinForms Forum
5 answers
657 views

I have a GridView where I am changing the cell BackColor when the value is changed:

 

void TelerikGridView_CellValueChanged(object sender, GridViewCellEventArgs e)
        {           
               
                    if (e.Row.Tag == null)
                        e.Row.Tag = e.Column.Name;
 
                    if (!e.Row.Tag.ToString().Contains(e.Column.Name))
                        e.Row.Tag += e.Column.Name;
                
        }

 

void TelerikGridView_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            if (e.Row.Tag != null && e.Row.Tag.ToString().Contains(e.Column.Name))
            {
               
                    e.CellElement.DrawFill = true;
                    e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
                    e.CellElement.BackColor = Color.Red;
              
            }
            else
            {
                e.CellElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
                e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local);
                e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local);
            }
        }

 

This is working as expected, now I want to add a "Reset" button, when I click on it I would like to reset or remove the format of all the cells that have been changed, how can I accomplish this?

 

Regards,

Alberto

Aseman
Top achievements
Rank 1
Veteran
 answered on 16 Dec 2019
1 answer
134 views

How I can loop through all row of my grid and detect only row with checkbox column checked ?

i use this solution and got error :  

-------------------------------------------------------------------------------------------------------

Error:

"System.NullReferenceException: 'Object reference not set to an instance of an object.'Telerik.WinControls.UI.GridViewCellInfo.Value.get returned null."
-------------------------------------------------------------------------------------------------------

Code:

IList<GridViewRowInfo> gridRows = new List<GridViewRowInfo>();
foreach (GridViewRowInfo rowInfo in radGridView.ChildRows)
{
    bool isChecked = (bool)rowInfo.Cells["CheckboxColumn"].Value;
    if (isChecked == true)
    {
        gridRows.Add(rowInfo);
    }
}

Nadya | Tech Support Engineer
Telerik team
 answered on 13 Dec 2019
1 answer
1.0K+ views

How I can search through all row of my grid and detect only row with checkbox column checked ?  ( Note : user change value and select checkbox at run time ... )

i use this code and got an error : 

------------------------------------------------------------------------------------------------------------------------------------

Error :

System.NullReferenceException: 'Object reference not set to an instance of an object.'

Telerik.WinControls.UI.GridViewCellInfo.Value.get returned null.

------------------------------------------------------------------------------------------------------------------------------------

Code : 

IList<GridViewRowInfo> gridRows = new List<GridViewRowInfo>();
foreach (GridViewRowInfo rowInfo in radGridView.ChildRows)
{
    bool isChecked = (bool)rowInfo.Cells["CheckboxColumn"].Value;
    if (isChecked == true)
    {
        gridRows.Add(rowInfo);
    }
}

------------------------------------------------------------------------------------------------------------------------------------

Nadya | Tech Support Engineer
Telerik team
 answered on 13 Dec 2019
1 answer
159 views

XML sample:

<?xml version="1.0" encoding="utf-8"?>
<TemplateLibrary xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="1.0" xmlns="http://www.example.org/NewXMLSchema">
  <Category name="Decks">
    <Category name="Standard Templates">
      <Category name="Deck Slabs">
        <Template name="Slab with constraints - 2 Lanes" guid="e4d44934-ff00-4c54-9de7-304896e0df45" lastRevisedDate="2015-08-31" lastRevisedBy="Sri.Kanneganti" versionMajor="1" versionMinor="32">
        </Template>
      </Category>
    </Category>
  </Category>
</TemplateLibrary>

 

my expected effect is like the attcached picture.

Nadya | Tech Support Engineer
Telerik team
 answered on 13 Dec 2019
1 answer
151 views

 How can I collapse the Titlebar ?

    this.FormElement.TitleBar.Visibility = ElementVisibility.Collapsed;

    => Not working

Nadya | Tech Support Engineer
Telerik team
 answered on 13 Dec 2019
3 answers
248 views

Code

Public Function NuevoExport(ByVal Grilla As RadGridView, ByVal Grilla2 As RadGridView) As Boolean

 For fila = 0 To Grilla.RowCount - 1
                For col As Integer = 0 To Ncol - 1
                    exHoja.Cells.Item(fila + 2, col + 1) = Grilla.Item(col, fila).Value
                Next
            Next

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Dec 2019
1 answer
188 views

So after i update data, gantt resets the position to the starting position, and i want to remain the same position

how to do that ?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Dec 2019
6 answers
210 views
I have a RadGridView which Layout should be saved whenever a column is added or removed by the user via columnChooser.

I added this code in Form.OnLoad:

foreach (GridViewDataColumn column in  myGrid.Columns)
{
  column.RadPropertyChanged += GridViewColumn_RadPropertyChanged;
}

And here is GridViewColumn_RadPropertyChanged event:

if (e.Property.Name == "IsVisible")
{
  myGrid.SaveLayout(myPath);
}


This works fine - as long as I do not load an existing GridLayout. When I check in Form.OnLoad if there is an saved layout file and load that layout file for my Grid, the RadPropertyChanged event will not be fired anymore. Is there something additional I have to do with RadGridView after a layout has been loaded successfully?
pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 12 Dec 2019
2 answers
264 views

Hi

I want to remove the shadow of the ribbontabs if they are drop-downed. Is there a possibility?

I tried the following:

            this.radRibbonBar1.RootElement.EnableBorderHighlight = false;
            this.radRibbonBar1.RootElement.EnableElementShadow = false;
            this.radRibbonBar1.RootElement.EnableFocusBorder = false;
            this.radRibbonBar1.RootElement.EnableFocusBorderAnimation = false;
            this.radRibbonBar1.RootElement.EnableHighlight = false;
            this.radRibbonBar1.RootElement.EnableRippleAnimation = false;

 

Thank you in Advance

 

Kind Regards,

Dominik

Dominik
Top achievements
Rank 1
 answered on 12 Dec 2019
4 answers
459 views

Hi

I adapted the height of a radRibbonBar with (radRibbonBarExpand):

            this.radRibbonBar1.RootElement.MaxSize = new System.Drawing.Size(0, 120);
            this.radRibbonBar1.RootElement.MinSize = new System.Drawing.Size(0, 120);

And wanted to change the height of the drop-downed tab the same size and tried (radRibbonBarDropDown):

            this.ribbonTab1.MinSize = new System.Drawing.Size(0, 20);
            this.ribbonTab2.MaxSize = new System.Drawing.Size(0, 50);

but the height stays the same. How is it possible to change this height?

 

Thank you in Advance

Kind Regards,

Dominik

 

 

Dominik
Top achievements
Rank 1
 answered on 12 Dec 2019
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
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?