Telerik Forums
UI for WinForms Forum
1 answer
149 views
Hey guys,

First and formost, this may not be an actual bug - there's a good chance I'm doing something a little bit abnormal.

I have a RadGridView (named gvwManifestLines) with these three columns:
            GridViewTextBoxColumn lengthColumn = new GridViewTextBoxColumn(); 
            lengthColumn.UniqueName = "LengthColumn"
            lengthColumn.HeaderText = "Length"
            lengthColumn.DataType = typeof(Int32); 
            lengthColumn.FieldName = "itemLength"
            lengthColumn.FormatString = "{0}cm"
            this.gvwManifestLines.Columns.Insert(i++, lengthColumn); 
 
            GridViewTextBoxColumn widthColumn = new GridViewTextBoxColumn(); 
            widthColumn.UniqueName = "WidthColumn"
            widthColumn.HeaderText = "Width"
            widthColumn.DataType = typeof(Int32); 
            widthColumn.FieldName = "itemWidth"
            widthColumn.FormatString = "{0}cm"
            this.gvwManifestLines.Columns.Insert(i++, widthColumn); 
 
            GridViewTextBoxColumn heightColumn = new GridViewTextBoxColumn(); 
            heightColumn.UniqueName = "HeightColumn"
            heightColumn.HeaderText = "Height"
            heightColumn.DataType = typeof(Int32); 
            heightColumn.FieldName = "itemHeight"
            heightColumn.FormatString = "{0}cm"
            this.gvwManifestLines.Columns.Insert(i++, heightColumn); 

I am handling that gridview's CellFormatting event as follows:
        private void gvwManifestLines_CellFormatting(object sender, CellFormattingEventArgs e) 
        { 
            GridViewCellInfo cellInfo = this.gvwManifestLines.Rows[e.CellElement.RowIndex].Cells[e.CellElement.ColumnIndex]; 
 
            if (e.CellElement.ColumnIndex == this.gvwManifestLines.Columns["LengthColumn"].Index || 
                e.CellElement.ColumnIndex == this.gvwManifestLines.Columns["WidthColumn"].Index || 
                e.CellElement.ColumnIndex == this.gvwManifestLines.Columns["HeightColumn"].Index) 
            { 
                if (cellInfo.Value == null || 
                    cellInfo.Value is DBNull || 
                    (int)cellInfo.Value <= 0) 
                { 
                    e.CellElement.FormatString = "n/a"
                } 
            }              
        } 

Essentially, I am using the length, width, and height values to calculate the volume per line in the volume column (omitted). I am doing a calculation in the grid's CellEndEdit for the length, width, height, and volume columns that will allow the user to either a) fill in length, width, and height to calculate the volume, or b) just enter in the volume and have the length, width and height ignored.

My implementation for this is to treat a value of '0' in the length, width or height column as a signifier that the calculation should ignore those three fields. However, it is confusing to have 0cm * 0cm * 0cm = 1000cm^2, so in the case of 0cm I want the display format to show as 'n/a'. It has a nicer feel.

This all works fine. The only problem is that when I pass the mouse over a cell that contains an 'n/a', the cell reverts back to '0cm' again until I click somewhere in the grid. There's a good change that the user will be doing a lot of back-and-forth waiving of the mouse around in the app, and this just looks sloppy.

What I wanted to do was to move my code in the CellFormatting handler into a private method, and then recall this method from within the CellMouseMove event. However, I am unsure how to use the MouseEventArgs to extract the relevant cell's row and column index information from the grid.

Additionally, there could be a better solution to this problem - I'm all ears!

Essentially, this isn't mission critical. It can wait for a bit, so I'm not going to be too worried about tinkering my way to a solution. I figure I'd just post here and see what comes up.
Nikolay
Telerik team
 answered on 22 Apr 2009
1 answer
88 views
By default TextPrimitive renders the '&' character as an underscore on the following character, like a menu hotkey.  I need to actually display an ampersand on the screen.  I found that if I double the character ("&&"), the TextPrimitive displays the ampersand.  However, it no longer sizes properly to the text it contains.  I'm wondering if the TextPrimitive sizing code thinks the ampersands will cause underlines even though the rendering code draws an ampersand.
Peter
Telerik team
 answered on 22 Apr 2009
2 answers
120 views
i currently loop through a month view to find out if certain cells have been selected

            SchedulerMonthViewElement monthView = this.schRates.SchedulerElement.ViewElement as SchedulerMonthViewElement;  
            Telerik.WinControls.RadElementCollection childrenCollection = monthView.Children[1].Children;  
 
 
            DateTime startDate = DateTime.MinValue;  
            DateTime endDate = DateTime.MinValue;    
 
 
            foreach (MonthCellElement cell in childrenCollection)  
            {  
                if (cell.Header.Selected == true)  
                {  
                    if (startDate == DateTime.MinValue)  
                    {  
                        startDate = cell.Date;  
                    }  
                    else  
                    {  
                        endDate = cell.Date;  
                    }  
                }  
 
                if (childrenCollection.IndexOf(cell) == 34)  
                { break; }  
            } 

i need to expand upon this, and check if any appointments already exist on a selected cell but cant seem to find any property or method within the cell item that will allow me to check this.

any help is greatly appreciated.

Cheers,
Craig
Craig Gamble
Top achievements
Rank 1
 answered on 21 Apr 2009
3 answers
149 views
Hi There:

I've just downloaded the latest Telerik Controls for winforms, the december release I think. I'm trying to create a visual style to the radgrid and it causes the following error:

Type Telerik.Wincontrols.UI.GridGroupExpanderCellEllement+SignStyles is from external Assembly Telerik.Wincontrols.GridView

Could you help me with this issue?

Thanks.
Nikolay
Telerik team
 answered on 21 Apr 2009
1 answer
104 views

Hi,

I am looking to use the RadGridView for one of my winforms application, so I will as well be performing UI automation and writing UI test frameworks around the control.

I would like to know if this control supports accessibility and works with MSAA or UIA technology.

Nick
Telerik team
 answered on 21 Apr 2009
1 answer
135 views

Hi,

I am looking to use the RadGridView for one of my winforms application, so I will as well be performing UI automation and writing UI test frameworks around the control.

I would like to know if this control supports accessibility and works with MSAA or UIA technology.

Nick
Telerik team
 answered on 21 Apr 2009
5 answers
260 views
Hello Everyone,
    I have spent the last two days reading threw both the help files and these forums.  So far I have not found a solution to my problem;
I am currently working with the Q1 2009 RadGridView, and I need to build a cell that can support multipal lines of text.  Sounds easy enough, but here is the twist.  In the lines of text I need to be able to display text in multipal colors.  I was really looking forward to the HTML like text format, but to my dismay it looks as if the RadGridView will not support this.   Can Anyone help me out?  To be honest I am just about at the Newbee level of a VB coder and need to come up with some solution.
Jack
Telerik team
 answered on 21 Apr 2009
7 answers
183 views
if i have a schedule that is setup as monthly view is it possible to find out the date range of the number of cells selected?

e.g. schedule is loaded and i highlight 2nd April - 16th April. i then click a button outside of the schedule - i want to be able to know the date range that has been highlighted?

i was trying to use the CellClick event even to loop through all cells and check which have been selected. but i cant find a way to loop through the cells?
foreach (SchedulerCellElement cell in ???)   
{  
if (cell.Selected == true)   
    {  
        MessageBox.Show(cell.Date.ToString());   
    }  

Cheers,
Craig
Craig Gamble
Top achievements
Rank 1
 answered on 21 Apr 2009
3 answers
183 views

Hi,

 

Is Ribbon merging supported on Q1 2009 ?

Thanks in advance.

 

Dan.

Peter
Telerik team
 answered on 21 Apr 2009
2 answers
1.0K+ views
I am trying to define a border only on the left, bottom, and right of a panel and the settings do not seem to stick.  I have set the top border width to 0 and it is still there.
Nick
Telerik team
 answered on 20 Apr 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?