Telerik Forums
UI for WinForms Forum
3 answers
130 views
Hi,

I cant get the summary row to show in my grid. This is the code I have for setting upo summary row

 

GridViewSummaryRowItem totals = new GridViewSummaryRowItem();

 

totals.Add(

new GridViewSummaryItem("Total", "{0}", GridAggregateFunction.Sum));

 

 

this.radGridView1.MasterGridViewTemplate.SummaryRowsBottom.Add(totals);

Am i missing something? Are there more properties i need to be setting on the grid or column or master view for the summary row to show ?

Thanks
Anisha

 

Anisha
Top achievements
Rank 1
 answered on 22 Apr 2009
1 answer
178 views
Hello, Ive been testing some of your controls and I love them, they are awesome. But Iam having a problem with the RadRibbonBar control. I cant find how to change a chunks border color. It seems like this should be really easy but I cant find how to do it anywhere. Ive tried using the theme builder but it seems like the designer stops just short of having the chunks in it. The theme builder stops at ExpandableStackLayout with nothing below it in the tree and if I use Edit UI Elements thats where all of the chunks properties are located. Now if try to use Edit UI Elements to try to change the chunks properties it only changes the "add new group" border color in Visual Studio's designer not any of the existing chunks border colors. I have also tried changing the color through code but I cant find a border color property anywhere. I know this has to be possible because the different themes the control comes with have different color borders on their chunks. Can you please point me in the right direction with a bit of sample code. I'm probably going to feel really stupid when you show me.... probably right in front of my face. Thanks for the help and for a great product.

Chris
Deyan
Telerik team
 answered on 22 Apr 2009
1 answer
256 views
I'm finding that if I call BestFitColumns, the column widths are set to one pixel.  I'm guessing this is happening because I call it too early, before the columns have been filled with data.  Can you suggest a good time to call this method?  Also, is it possible to combine the best fit behavior and still make one of the columns be "stretchy" -- i.e. take up the remaining space?  My goal is that all but one of the columns would size to their content, and that the remaining column would stretch to consume the remaining space.
Nick
Telerik team
 answered on 22 Apr 2009
1 answer
142 views
I'm wondering how I could catch the event when you click on the "delete row" in the default context menu.

What I want to do is when I click on that, it removes the row from one gridview and it has to be added to another gridview.

I was searching in the helpfiles but I didn't find anything that could help me.

thanks in advanced
Nick
Telerik team
 answered on 22 Apr 2009
12 answers
197 views
An error occurs in the cellFormating event:

in the first databinding of gridview the error does not happen , but if I try  a second databinding, for refresh the gridview,
the following error occurs:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.Primitives.TextPrimitive.MeasureOverride(SizeF availableSize)

The code where the error occurs is the folowing:

 private void gvPremios_CellFormatting(object sender, CellFormattingEventArgs e)  
                         {  
 if (e.CellElement.ColumnInfo is GridViewDataColumn && !(e.CellElement.RowElement is GridTableHeaderRowElement))  
                             {  
                                     GridViewDataColumn column = (GridViewDataColumn)e.CellElement.ColumnInfo;  
 
                                     if (column.DataField == "MyColumn")  
                                     {                         
                                         if (e.CellElement.Children.Count > 0)  
                                             return;  
 
                                         RadLabelElement element = new RadLabelElement();  
                                         element.Text = "<html>This is a test..."                                           
                                        e.CellElement.Children.Add(element);  
                                     }  

The strange thing is in the "element.text" property, that if I not put the the tag "<html>"... the error does not happen, but, i need formating the field with a html code...
And the property "DisableHTMLRendering=false"  is not working as it should, leaving the whole column unconfigured.

Nikolay
Telerik team
 answered on 22 Apr 2009
10 answers
158 views
I've got something strange... 

My third child, when having only 1 row, it's not showing the row.

I took a screenshot of it

http://picasaweb.google.com/gerbrand.adlogix/TelerikViewIssues?feat=directlink

I'm not doing anything special in my code to make the grid. I've got it only with one record. When I have more records, I get to see them.


Jack
Telerik team
 answered on 22 Apr 2009
1 answer
261 views
I'm finding that the Grid doesn't use the font of its parent for the column headers and cells.  Is there a way to cause it to do so?
Mike
Telerik team
 answered on 22 Apr 2009
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
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
ProgressBar
CheckedDropDownList
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?