Telerik Forums
UI for WinForms Forum
2 answers
338 views
Hey all

I'm trying to add a background color to a RadGridView cell. I often did it before and it always works perfectly, just in this case it's not working properly. Here you can see my code:

if (e.Column.Name == "BM")
{
    foreach (string rs in BmList)
    {
        if (rs == e.Row.Cells["RS"].Value.ToString())
        {
            e.CellElement.DrawFill = true;
            e.CellElement.BackColor = Color.FromArgb(238, 127, 0);
            e.CellElement.NumberOfColors = 1;
        }

        else
        {
            e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
            e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
            e.CellElement.ResetValue(LightVisualElement.NumberOfColorsProperty, ValueResetFlags.Local);
        }
    }
}

This code is just coloring 1 cell, even if there are more in the list. The debugger says, in my list called "BmList" are 18 items. But it colors just one. So I'm wondering why its not coloring every cell. When I remove the foreach loop, it works fine. And when I use this code instead of "e.CellElement" it works as well:

e.Row.Cells["BM"].Style.BackColor = Color.FromArgb(238, 127, 0);
e.Row.Cells["BM"].Style.DrawFill = true;
e.Row.Cells["BM"].Style.CustomizeFill = true;

Does anyone know about that behaviour? Or am I doing something wrong?

I hope someone can help me

Regards,
Danilo
Danilo
Top achievements
Rank 1
 answered on 31 Mar 2015
2 answers
59 views
1. When using the Office2013Light theme, the styles that are applied to PageView tabs do not match
the styles of child hierarchy template tabs. Please see attached. Is there a workaround to get the child
template tabs to match the PageView tabs (as occurs when using other themes)?

2. When more than one child hierarchy template is added, all rows are
expanded by default, whereas when a single child template is added, the rows are
collapsed. How do I ensure that the rows remain collapsed when adding more
than one child template in a hierarchy?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Mar 2015
9 answers
728 views
Hello -

I have one of my gridview columns set to wrap text. What I would like to see happen is that when the text wraps in a row, the row resizes itself to show all the text. However, it isn't doing that, so my text in the column that wrapped is all scrunched up. Is there a way to tell the grid to either resize the rows where the text in a column has wrapped, or at least, set each row to be 2 rows high?
Niloofar
Top achievements
Rank 1
 answered on 30 Mar 2015
14 answers
363 views
Is there any way to show that a RadDropDownList has the focus?
Stefan
Telerik team
 answered on 30 Mar 2015
1 answer
155 views
Dear Telerik, 


how to change the handler of the zooming instead of CTRL & mouse scroll.
Dimitar
Telerik team
 answered on 30 Mar 2015
1 answer
207 views
Dear Telerik

Can I build append a new series to any chart in anew panel. (check the attachments please).
Or can i Sync the zoom and scroll between two different charts.




,


Hristo
Telerik team
 answered on 30 Mar 2015
1 answer
1.3K+ views
Hello Team,

I am using rad gridview in one of my ongoing application. I have 4 radgrids in my form. I have one primary grid which will be filled in my forms OnLoad event. On my forms load event, columns and data will be loaded dynamically for the  Primary gridView. Based on key field value my application will fetch records for the remaining three grids.This will happen on Primary radgridview's cell click event. 

In the primary gridview i have a column for which i want to keep fore color based on certain condition. This column shows the status of a particular items expiry date. if the item has already expired then this column text value is "expired" and the forecolor should be red. if item is getting expired within 30 then the fore color should be orange and if item expiry date is more than 30 days then fore color is green.

I am Formatting the cell in CellFormatting event. In this event i am checking whether the CellElement is GridViewDataColumn , if yes then will check the value of the cellelement ie text property. Conditionally i will assign the forecolor. Formatting for the status column is absolutely fine but at the same time it also changes the fore color for other columns data. whenever i move the mouse over these columns  or scroll the gridview to see other rows the forecolor keeps changing randomly  e.g initial it will be red then on mouse hove or on radgridview row scrolling top - bottom and vice -versa fore color is some times red,orange,green,black for these columns.

Please help in avoiding the other columns getting forecolor. Other columns except status column should have normal black forecolor.

Thanks & Regards,

Krunal.









Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Mar 2015
1 answer
167 views
RadChartView Series lost it's color after applied Theme.
Please check attached screen shot.
I was applied theme in SplashScreen (ThemeResolutionService.ApplicationThemeName = Office2010BlueTheme1.ThemeName)
Dimitar
Telerik team
 answered on 30 Mar 2015
5 answers
669 views
Hello

I would like to know how to change the displayed text of an Hyperlink column in an unbound Gridview in C#.

I added the hyperlink column like this (replaces an already existing column containing the shortcut):
GridViewHyperlinkColumn hyperlinkColumn = new GridViewHyperlinkColumn("shortcut");
hyperlinkColumn.ReadOnly = true;
hyperlinkColumn.Width = 200;
radGridDocuments.Columns.Remove("shortcut");
radGridDocuments.Columns.Add(hyperlinkColumn);

It displays the link correctly, and I am able to click on it to open documents or websites, but I would like to change the text displayed to a more user-friendly text, like simply the document's name instead of the full "\\sharefolder\somefolder\someusername\somedocument.doc", or the full "http://www.telerik.com/forums/winforms/gridview/etc.html".

I have the text I want displayed in another column, on the same row.

Thanks.
Hristo
Telerik team
 answered on 27 Mar 2015
1 answer
88 views
I have created a DocumentWindow object in runtime.  I would like to change it to a Docked type by triggered by a Context Menu item I have created.  This triggers just fine, but when I use the statement below (with loDock being the reference to the RadDock control and loDockWin being the reference to the DocumentWindow object):

loDock.DockWindow(loDockWin, DockPosition.Left);

it just creates another Tab Group on the left and puts my tab in it.

Laura
Dimitar
Telerik team
 answered on 27 Mar 2015
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
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?