Telerik Forums
UI for WinForms Forum
2 answers
138 views
Hi,
I need to change the backcolor, forecolor etc of a complete row.
I dont want to use any events.
I am adding rows to gridview in an event, in whose arguments  i am already supplied with a color. So i just want it like in a standard listview:
this.listviewcontrol.forecolor = color.red;
is this way possible in formatting a row of gridview.
I have already tried 
this.gvTCPIPEvents.Rows[this.gvTCPIPEvents.Rows.Count - 1].VisualElement.ForeColor = e.messageColor;
but nothing happens.
I dont wish to use any of the rowformatting or cellformatting events, as listed on all of the posts.
Any workaround possible.
Nikk grey
Top achievements
Rank 1
 answered on 11 Dec 2009
3 answers
167 views
Hi,

I'm having a problem with creating a complex filter expression in RadGridView.

The scenario can be described like this:
I have a DataTable containing columns Name (string), Address (string) and Finished (bool).
I'm giving the user the possibility to do a freetext search in the grid, where the user enters a text in a textbox, and I apply filters on columns Name and Address using Contains(entered string).

The above works fine. However, the problem is that I also have a checkbox "Show finished" that should always filter the data on the "Finished" column. I'm not able to get the correct filter expression for this, since when I add the Finished filter it's added as an OR filter with the other columns.

So in total I want a filter in the GridView that is something like this:
Finished=0 AND (Name LIKE '%text%' OR Address LIKE '%text%')
but I'm only able to get:
Finished=0 OR Name LIKE '%text%' OR Address LIKE '%text%'

Is this currently possible to do in some way?

Regards,
Tommy Savela
Nick
Telerik team
 answered on 11 Dec 2009
3 answers
154 views
I have a WinForms application using a RadForm.  The form makes extensive use of the Rad Controls and when I resize the form to a small width I get the following error:
"{"Value of '-2' is not valid for 'LargeChange'. 'LargeChange' must be greater than or equal to 0.\r\nParameter name: LargeChange"}"

Here is the complete stack trace
at Telerik.WinControls.UI.RadScrollBarElement.set_LargeChange(Int32 value)\r\n   
at Telerik.WinControls.UI.GridTableElement.UpdateHScrollBarVisibility(SizeF bodySize, SizeF vscrollbarSize)\r\n   
at Telerik.WinControls.UI.GridTableElement.ArrangeScrollbars(RectangleF& bodyRect, RectangleF clientRect)\r\n   
at Telerik.WinControls.UI.GridTableElement.ArrangeOverride(SizeF finalSize)\r\n   
at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.RootRadElement.ArrangeOverride(SizeF finalSize)\r\n   
at Telerik.WinControls.RootRadElement.ArrangeCore(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.ComponentLayoutElementTree.PerformInnerLayout(Boolean performMeasure, Int32 x, Int32 y, Int32 width, Int32 height)\r\n   
at Telerik.WinControls.ComponentLayoutElementTree.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)\r\n   
at Telerik.WinControls.RadControl.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)\r\n   
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.ApplyCachedBounds(IArrangedElement container)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)\r\n   
at System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)\r\n   
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)\r\n   
at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)\r\n   
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)\r\n   
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)\r\n   
at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)\r\n   
at System.Windows.Forms.Control.OnResize(EventArgs e)\r\n   
at System.Windows.Forms.Panel.OnResize(EventArgs eventargs)\r\n   
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)\r\n   
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)\r\n   
at System.Windows.Forms.Control.UpdateBounds()\r\n   
at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)\r\n   
at System.Windows.Forms.Control.WndProc(Message& m)\r\n   
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   
at System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)\r\n   
at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)\r\n  
at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)\r\n   
at System.Windows.Forms.Control.set_Bounds(Rectangle value)\r\n   at Telerik.WinControls.RadHostItem.SetControlBounds(Rectangle bounds)\r\n  
at Telerik.WinControls.RadHostItem.ArrangeCore(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.ArrangeOverride(SizeF finalSize)\r\n   
at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)\r\n  
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.Layouts.DockLayoutPanel.ArrangeOverride(SizeF arrangeSize)\r\n   
at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.ArrangeOverride(SizeF finalSize)\r\n   
at Telerik.WinControls.UI.RadTabStripElement.ArrangeOverride(SizeF finalSize)\r\n   
at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)\r\n   
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.RootRadElement.ArrangeOverride(SizeF finalSize)\r\n  
at Telerik.WinControls.RootRadElement.ArrangeCore(RectangleF finalRect)\r\n  
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)\r\n   
at Telerik.WinControls.ComponentLayoutElementTree.PerformInnerLayout(Boolean performMeasure, Int32 x, Int32 y, Int32 width, Int32 height)\r\n   
at Telerik.WinControls.ComponentLayoutElementTree.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)\r\n   
t Telerik.WinControls.RadControl.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)\r\n   
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)\r\n   
at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)\r\n   
at System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)\r\n   
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)\r\n   at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)\r\n   
at System.Windows.Forms.Form.OnLayout(LayoutEventArgs levent)\r\n   
at Telerik.WinControls.UI.RadFormControlBase.OnLayout(LayoutEventArgs levent)\r\n   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)\r\n   
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)\r\n   
at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)\r\n   
at System.Windows.Forms.Control.OnResize(EventArgs e)\r\n   
at System.Windows.Forms.Form.OnResize(EventArgs e)\r\n   
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)\r\n   
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)\r\n   
at System.Windows.Forms.Control.UpdateBounds()\r\n   at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)\r\n   
at System.Windows.Forms.Control.WndProc(Message& m)\r\n   
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   
at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n   at System.Windows.Forms.Form.WmWindowPosChanged(Message& m)\r\n   
at System.Windows.Forms.Form.WndProc(Message& m)\r\n  
at Telerik.WinControls.UI.RadFormControlBase.WndProc(Message& m)\r\n   
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n   
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)\r\n   
at System.Windows.Forms.Form.DefWndProc(Message& m)\r\n   
at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   
at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n   at System.Windows.Forms.Form.WmSysCommand(Message& m)\r\n   
at System.Windows.Forms.Form.WndProc(Message& m)\r\n   at Telerik.WinControls.UI.RadFormControlBase.WndProc(Message& m)\r\n   
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n  
 at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n   
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)\r\n   at System.Windows.Forms.Form.DefWndProc(Message& m)\r\n   
at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   
at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n   at System.Windows.Forms.Form.WmNcButtonDown(Message& m)\r\n   
at System.Windows.Forms.Form.WndProc(Message& m)\r\n   at Telerik.WinControls.UI.RadFormControlBase.WndProc(Message& m)\r\n   
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n 
 at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n   
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   
at System.Windows.Forms.Application.Run(Form mainForm)\r\n   at OnlineCurriculum.DataEntry.Program.Main() in C:\\MCPS\\Portal\\Trunk\\Source\\OnlineCurriculum\\OnlineCurriculum.DataEntry\\Program.cs:line 18"
Any ideas on this?
Nikolay
Telerik team
 answered on 11 Dec 2009
1 answer
100 views
I have a Calendar control that is contatined within a Tool Window.

The Tool Window is hidden on startup.

When the Tool Window becomes 'un-hidden' I need to refresh the calendar control, i.e. change back colour for some of the dates.

Trouble is I've no idea what event is going to give me the opportunity to do this:(

Can anyone help me out here?

Thx
Nikolay
Telerik team
 answered on 11 Dec 2009
1 answer
95 views
RadGridView Columns sometime disappear.

For example:
I have set BindingSource, deleted not needed columns (leaving 2 TextBoxColumns on the GridView) and then added LookupColumn. When I have clicked OK button, the LookupColumn disappeared.
Julian Benkov
Telerik team
 answered on 11 Dec 2009
1 answer
265 views
I have a RadDock control that contains Tool Windows, Document Windows and Shaped Forms.

I want to be able to display a list of hidden windows and restore them to their pre-hidden state.

Questions :-

- Is there a list of these windows somewhere or do I have to track the windows that are hidden?
- If I need to track the windows that are hidden how do I do that?
- Any suggestions as to which control would be best suited to display the list of hidden windows, i.e. if you've done it before, used a particular control and it worked well

Thx
Nikolay
Telerik team
 answered on 11 Dec 2009
1 answer
77 views
Ok i have an array that i bind to the chart, with the following values

17
18
0
0
0
22
23
0
24
0
0
21
0
18

I know there is supposed to be an EptyValue property that approximates the empty (0 ???) values, but how can i use it ?
Currently i don't see any results on the chart
I use a bar chart and as it is now, the 0 values do not get approximated
Ves
Telerik team
 answered on 11 Dec 2009
2 answers
160 views
It drives me absolutly crazy when I make a change in the design mode and the change doesn't show up when I debug it. Where does Telerik store the settings for the UI at? I know its a binary file somewhere, I have came across it before and I know If delete it, it will be rebuilt with the latest settings. I hate spending 20 mins having to trick the Telerik stuff into working and I am a little frustrated. I know I could explain in greater detail what is going on but first I would really like to know where the settings file is.
Donnie
Top achievements
Rank 1
 answered on 10 Dec 2009
2 answers
172 views
The following link points to a Visual Studio 2008 VB.NET project that demonstrates some grid editing problems. I need advice on these problems.

http://www.glt1.com/gl/misc/GridView20091207.zip

Here are three sets of steps to produce the problems:

Run the project
Click in the "Row Text" column of the third row. The row is highlighted as expected.
Click again in the "Row Text" column of the third row. The cell goes into edit mode. The row size decreases so that the cell editor is only a single line. The row SHOULD have remained the same size.
Click in the "Row Text" column of the first row. The cell goes into edit mode as expected.
Click in the "Row Text" column of the third row. The cell goes into edit mode as expected, while remaining the correct size. It seems to stay the correct size from this point on, that is, the downsizing-to-one-line problem seems to occur only when going into edit mode for the first time.

Run the project
Click in the "Row Text" column of the third row. The row is highlighted as expected.
Click again in the "Row Text" column of the third row. The cell goes into edit mode (and the row sizing problem is evident once again).
Click just to the left of the first letter ("R") in the "Row Text" column of the third row. The cell text un-highlights and the caret is positioned at the beginning of the cell text as expected.
Press the left arrow key. The cell focus moves to the first column (skipping the read-only second column) as expected.
Press the left arrow key again. The cell focus moves very briefly to the "Row Text" column of the second row, but then quickly moves to the checkbox column of the second row. The cell focus SHOULD have stayed on the "Row Text" column of the second row.
Press the left arrow key again. The cell focus moves very briefly to the "Row Text" column of the first row, but then quickly moves to the checkbox column of the first row. The cell focus SHOULD have stayed on the "Row Text" column of the first row.

Run the project
Click in the "Row Text" column of the fourth row. The row is highlighted as expected.
Click again in the "Row Text" column of the fourth row. The cell goes into edit mode (and the row sizing problem is evident again).
Click in the "Row Text" column of the third row. The cell is focused as expected.
Click anywhere on the third line of text in the "Row Text" column of the third row. The cell text un-highlights and the caret is positioned on the third line of text as expected.
Press the up arrow key. The caret moves to the second line of text in the cell.
Press the up arrow key again. The cell focus moves to the "Row Text" column of the second row. The caret SHOULD have moved to the first line of text in the "Row Text" column of the third row.

Martin Vasilev
Telerik team
 answered on 10 Dec 2009
2 answers
208 views
I'm trying to pop up a MsgBox in a GridView's CellValidating event. like this:

If e.Value.ToString.Length = 0 Then 
    e.Cancel = True 
    MsgBox("Text is required.")  
End If 

The event keeps firing over and over, causing the MsgBox to appear "a million" times, and finally, the MsgBox AND the Form that contains the GridView both lose the text in their title bar.

I can use a flag like this:

If e.Value.ToString.Length = 0 Then 
    If Not validationInProgress Then 
        validationInProgress = True 
        e.Cancel = True 
        MsgBox("Text is required.")  
        validationInProgress = False 
    End If 
End If 

...and it works correctly, as long as I am trying to navigate away from the cell to some other element in the grid. If I click on any other control on the form, I get the message twice (???) but then the focus still goes to whatever other control it was I clicked on. For example, I have a "Close" button on the form, and I want the user to be able to click it to cancel their edits and not get the validation MsgBox, but instead I want to show a "Discard changes?" type dialog. Any ideas?

PS: If possible, please provide tech specs on exactly what causes the event to fire, such as the gridview losing focus, etc.
Martin Vasilev
Telerik team
 answered on 10 Dec 2009
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)
Chart (obsolete as of Q1 2013)
Form
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
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
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
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?