Telerik Forums
UI for WinForms Forum
1 answer
202 views
I'm trying to highlight my group rows in a grid based on their aggregate values. For example I have values for Max and Current, and depending on the percentage of values I would like to highlight the group header yellow/red/violet/green as appropriate. The attached code soomewhat works except it highlights the entire grid green, any help you can provide. (This is in the GroupSumaryEvaluate event.

            AggregateCollection coll = e.Group.Aggregates; 
            double max = 0, current = 0; 
            foreach (Aggregate agg in coll) 
            { 
                switch (agg.FieldName) 
                { 
                    case "max": 
                        max += Convert.ToDouble(agg.Value.ToString()); 
                        break; 
                    case "current": 
                        current += Convert.ToDouble(agg.Value.ToString()); 
                        break; 
                } 
            } 
            double percentage = 0; 
            if (max == 0 && current == 0) 
            { 
                percentage = 0; 
            } 
            else 
            { 
                if (max == 0 && current > 0) 
                { 
                    percentage = 1.1; 
                } 
                else 
                { 
                    percentage = current / max; 
                } 
            } 
            if (percentage > 0) 
            { 
e.Group.HeaderRow.GridViewInfo.GridViewElement.BackColor = Color.LightGreen;
            } 
            if (percentage >= .6) // Indicate middle tier (yellow) 
            { 
                e.Group.HeaderRow.GridViewInfo.GridViewElement.BackColor = Color.Yellow; 
            } 
            if (percentage >= .8) // Indicate upper tier (red) 
            { 
                e.Group.HeaderRow.GridViewInfo.GridViewElement.BackColor = Color.Red; 
            } 
            if (percentage > 1.0) // Indicate overbooked (violet) 
            { 
                e.Group.HeaderRow.GridViewInfo.GridViewElement.BackColor = Color.Violet; 
            } 

Deyan
Telerik team
 answered on 24 Aug 2009
3 answers
190 views
Hi, I am trying to set Focus on the GridView Filtering box when F2 Key is pressed.

Any idea ?

regards
Nick
Telerik team
 answered on 24 Aug 2009
1 answer
186 views
when i click a row in grid, i want to show dialog to addnew or edit form.
how i do? please help me
sorry i am newbie
thanks all
Victor
Telerik team
 answered on 21 Aug 2009
1 answer
122 views
Hi

Please look on this URL (http://65.57.255.33/GridViewWithHeader.JPG)
I need to group only column header like this. I am Rad Control Win Form (Q2 2009).
Please help me.

Regards
Atul Kumar Srivastav
Nick
Telerik team
 answered on 21 Aug 2009
1 answer
144 views

I can set the parent TableHeaderHeight for a RadGridView no problem...

((GridTableElement)this.radGridView1.GridElement).TableHeaderHeight = 20;

However I need to set the Header height on the related GridViewTemplate.
How can this be done programmatically?





Victor
Telerik team
 answered on 21 Aug 2009
1 answer
174 views
Hello,
this issue was produced on machines with Windows XP. When we move some window across application with Telerik RadForm, then there is some kind of a repaint glitch (as seen in picture). Is there any way how to fix this? (this same issue is also presented in sample application shiped with telerik).

Deyan
Telerik team
 answered on 21 Aug 2009
2 answers
84 views
Hello Experts. Here's what I try to do. I have a column in which the user can select some text to which is assigned a value.:

 


Dim
ds_typ_czujnika As New DataTable

 

ds_typ_czujnika.Columns.Add(

"id")

 

ds_typ_czujnika.Columns.Add(

"naz")

 

Dim myCommand As SqlCommand

 

 

Dim dr As SqlDataReader

 

conn_dodatkowe.Open()

myCommand =

New SqlCommand("select id_typ as id, nazwa as naz from tab_urzadzenia_typy where akt = 'True' order by nazwa", conn_dodatkowe)

 

myCommand.CommandType = CommandType.Text

dr = myCommand.ExecuteReader()

 

While dr.Read()

 

ds_typ_czujnika.Rows.Add(dr(0), dr(1))

 

End While

 

dr.Close()

conn_dodatkowe.Close()

 


Dim
k0 As New
GridViewLookUpColumn()

 

k0.FieldName =

"typ_czujnika"

 

k0.FieldAlias =

"typ_czujnika"

 

k0.UniqueName =

"typ_czujnika"

 

k0.HeaderText = lng.zwroc_napis_z_nazwy_elementu(

"typ_czujnika")

 

k0.DataSource = ds_typ_czujnika

k0.DisplayMember =

"naz"

 

k0.ValueMember =

"id"

 

 

Me.gv_ustawienia.Columns.Add(k0)

Now, I have  drag&drop event and I can read the values of columns, including a pre-selected text from k0. Is there any way to read the value id (k0.value member) assigned to that text directly from this row ? 

Thank's a lot for help.

 

Dim

 

p As System.Drawing.Point = gv_ustawienia.PointToClient(New System.Drawing.Point(e.X, e.Y))

 

 

Dim element As RadElement = gv_ustawienia.ElementTree.GetElementAtPoint(p)

 

 

Dim cell As GridCellElement = TryCast(element, GridCellElement)

 

 

Dim row As GridRowElement = Nothing

 

 

 

 

If cell IsNot Nothing And Not (TypeOf (element) Is GridHeaderCellElement) Then

 

 

 

row = cell.RowElement
....

Krzysztof
Top achievements
Rank 1
 answered on 21 Aug 2009
8 answers
408 views
Hi,

I have an unbound simple grid with editable cells in it. I carry out a number of edits, which all work fine. But when the user wants to repopulate the grid, I call my refresh code, which includes completely rebuilding the grid. As part of that code I call

Telerik.WinControls.UI.

ColumnGroupsViewDefinition columnGroupsDefinition = this.radGridView.ViewDefinition as Telerik.WinControls.UI.ColumnGroupsViewDefinition;

 

columnGroupsDefinition.ColumnGroups.Clear();

 

if (this.radGridView.Columns.Count > 0) this.radGridView.Columns.Clear();

 

 

if(this.radGridView.Rows.Count > 0) this.radGridView.Rows.Clear();

 


To clear out the entire grid. I then follow a standard routing for repopulation adding columns and rows as required. Subsequently all attempts to set .CurrentRow, or to click between cells returns a NullReferenceException as shown in the stack below.

I suspect my problem is that I'm not "telling" the grid to clear itself properly but cannot find a wholesale "ClearAll" method. I also suspect the problem relates to tracking of the current Cell as there is a lot of dependence on there being a current cell inside EndEditCore, and its not explicitly checked for Null.

Can you assist ?

(My stack trace below).

An unhandled exception has occured with the following details
Message Object reference not set to an instance of an object.
Stack Trace
   at Telerik.WinControls.UI.RadGridView.EndEditCore(Boolean cancel, Boolean finishEditingOperation)
   at Telerik.WinControls.UI.RadGridView.EndEdit()
   at Telerik.WinControls.UI.RadGridView.ValidatePositionChange(GridViewRowInfo rowInfo, GridViewColumn column)
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDownLeft(MouseEventArgs e)
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDown(MouseEventArgs e)
   at Telerik.WinControls.UI.RadGridView.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Additional Data
TicketNumber 21c900c6-0ab5-4f64-bc53-839a3a783e45

Victor
Telerik team
 answered on 21 Aug 2009
1 answer
168 views
Hi!

I have a new problem with your controls. In our company application, we will use many hierarchical RadGridView controls to present data. It's a simple way to make a lot of function without creating many separete forms. But we have some questions and some problems... We used WinForms controls, our database is created in MS SQL Server 2008, and we use LINQ to communicate with it.

1. What is the best way to connect RadGridView to the LINQ (in designer there's no such option like LINQ datasource...)?

2. Second problem is with Inserting (we don't implement deleting yet) the data to hierachical Grid. I have read this post on your forum. And I have question is it still unavalible option? Is there any way to avoid this limitations?
Julian Benkov
Telerik team
 answered on 21 Aug 2009
5 answers
257 views

When an empty RadGridView is shown the RadGridView shows the message "no data to display".

When i set a RadGridLocalizationProvider then it should show the translated message from the NoDataText RadGridStringId, but it  shows the message "no data to display". This happens in the initialisation of the RadGridView. 

When i clear the columns of the RadGridView then the correct translated message is shown.

Regards,

Ramius 

Nick
Telerik team
 answered on 21 Aug 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)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?