Telerik Forums
UI for WinForms Forum
1 answer
142 views
Hello.

I have another question I would like to group the table on one of the column. I try to do this using this code, but it's not work:

 

Dim gbe As New GridGroupByExpression("Grupa Group By Grupa")

 

gv_dodatkowe.MasterGridViewTemplate.GroupByExpressions.Add(gbe)


What i'm doing wrong ?

Thanks a lot for help.
Mike
Telerik team
 answered on 06 Jul 2009
3 answers
95 views
If I have a grid full of data and I hide some of the rows (by setting row.IsVisible = false), will my column summaries exclude those rows from the calculations? Or do I need to physically remove the row from the grid?

Thanks,
Ben
Jack
Telerik team
 answered on 06 Jul 2009
3 answers
232 views
Hi

I am sure I am missing something very simple, how do I make the datetimepicker popup, as in show the calendar when the control is minimised?
Boryana
Telerik team
 answered on 06 Jul 2009
2 answers
113 views
Hello, my problem is simple. unfortunately I can not deal with it alone.
I want to put RadCalendar in a single cell of the RadGridView , so that date was not written only selected.Can this be done somehow?
I saw a solution to fix the whole column in this way, but I need to do this with a single cell.
Best regards and thank you.
Krzysztof
Top achievements
Rank 1
 answered on 06 Jul 2009
1 answer
71 views
After upgrading to 2008 Q2 my application crashes in several grid event handlers.

For example the CellFormatting event is now also fired for the Filter Row and when the event handler wants to get the data for the cell, it's obviously Null when the grid loads and no filter is set.

If there are there are other breaking changes to the Grid, please update the documentation.

Worked Pre Q2:
       void _grid_CellFormatting(object sender, CellFormattingEventArgs e)  
        {  
            if (e.CellElement.ColumnInfo is GridViewDataColumn && !(e.CellElement.RowElement is GridTableHeaderRowElement))  
 
            {  
 
                GridViewDataColumn column = (GridViewDataColumn)e.CellElement.ColumnInfo;  
 
                if (column.FieldName == "Minutes")  
                {  
                    int minutes = (int)e.CellElement.RowInfo.Cells["Minutes"].Value;  
                    TimeSpan ts = TimeSpan.FromMinutes(minutes);  
                    e.CellElement.Text = string.Format("{0:00}:{1:00}", ts.Hours, ts.Minutes);  
 
 
 
 

Now have to add an additional test (plus additional test of NULL returned by the DB which is not currently possible by the Data Definition).

      void _grid_CellFormatting(object sender, CellFormattingEventArgs e)  
        {  
            if (e.CellElement.ColumnInfo is GridViewDataColumn && (!(e.CellElement.RowInfo is GridViewFilteringRowInfo)) &&                                  
                (!(e.CellElement.RowElement is GridTableHeaderRowElement)))  
            {  
 
                GridViewDataColumn column = (GridViewDataColumn)e.CellElement.ColumnInfo;  
 
                if (column.FieldName == "Minutes")  
                {  
                    if(e.CellElement.RowInfo.Cells["Minutes"].Value!=null)  
                    {  
                        int minutes = (int)e.CellElement.RowInfo.Cells["Minutes"].Value;  
                        TimeSpan ts = TimeSpan.FromMinutes(minutes);  
             

regards
Erwin
Jack
Telerik team
 answered on 06 Jul 2009
9 answers
585 views
Hello,

Is there an easy way to reset the Grid Layout to its default layout?

Thanks,
Tommy
Nick
Telerik team
 answered on 06 Jul 2009
5 answers
110 views
Hello Telerik Team,

I encountered this issue: If you
- open a RadDateTimePicker
- select a date
- open it again and
- select the same date again,
the picker will show January the 1st, 1980.

Have a nice weekend,
STB


Boryana
Telerik team
 answered on 06 Jul 2009
2 answers
219 views

I have an image cell where the image is added conditionally using CellFormatting:

Private Sub RadGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting

        Try

 

            If e.CellElement.ColumnIndex = 1 Then

                If CType(e.CellElement.RowInfo.Cells("type").Value = 0, Decimal) Then

                    e.CellElement.Image = Me.ImageList1.Images(0)

                ElseIf CType(e.CellElement.RowInfo.Cells("type").Value = 1, Decimal) Then

                    e.CellElement.Image = Me.ImageList1.Images(1)

                ElseIf CType(e.CellElement.RowInfo.Cells("type").Value = 2, Decimal) Then

                    e.CellElement.Image = Me.ImageList1.Images(2)

                ElseIf CType(e.CellElement.RowInfo.Cells("type").Value = 3, Decimal) Then

                    e.CellElement.Image = Me.ImageList1.Images(3)

                Else

                    e.CellElement.Image = Me.ImageList1.Images(3)

                End If

            End If

            e.CellElement.DrawFill = True

            If Not IsDBNull(e.CellElement.RowInfo.Cells("Status").Value) Then

                e.CellElement.DrawFill = True

                Select Case (e.CellElement.RowInfo.Cells("Status").Value)

                    Case 23

                        e.CellElement.BackColor = Color.Pink

                    Case 24

                        e.CellElement.BackColor = Color.Chartreuse

                    Case 25

                        e.CellElement.BackColor = Color.Yellow

                    Case 26

                        e.CellElement.BackColor = Color.SkyBlue

                    Case 27

                        e.CellElement.BackColor = Color.LightCyan

                    Case 28

                        e.CellElement.BackColor = Color.Crimson

                    Case 29

                        e.CellElement.BackColor = Color.Blue

                    Case 30

                        e.CellElement.BackColor = Color.Red

                    Case Else

                End Select

            Else

                e.CellElement.BackColor = Color.WhiteSmoke

            End If

 

        Catch ex As Exception

            MsgBox(Err.Description)

        End Try

    End Sub

This colours the whole row I only want the background behind the image to have the colour applied how do I do this?

Regards
Joe

Joe Bohen
Top achievements
Rank 1
 answered on 04 Jul 2009
7 answers
680 views
Hello,

Q1 2009 Winform controls.

I am having a little trouble with wrapping text and autosizing rows.   I have a gridview on a form with a checkbox at the top to define whether to show the full cell text or not.

As far as wrapping text and the rows autosizing, I cannot even get this to work correctly. The problems are:

1..Wrapping of text and resizing of rows only seems to work correctly if the line this.radGridViewExceptions.MasterGridViewTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; is not commented out.  If this is commented out and I set the column widths in the swtich, the description column, which has the most text, only shows 2 lines of text fully. The 3rd and final line in that cell shows about 10% of the top of the 3rd line, the rest is cut off.

2..The cursor changes to an arrow pointing up and down, like it is going to let me resize the row, but I cannot resize it even though AllowResize is set to true in the designer properties

3...My functional requirement is that on clicking the checkbox to not show full text, the rows go back to only show one line of text and do not wrap.  So in the event handler for the checkbox I go through the columns in the grid and set WrapText to the checked state of the checkbox.  This either enables or disables wrapping ok, but the row height when going from wraptext =true to wraptext = false does not change so I am left with thick and thin rows.  I want all rows to be thin, ie all the same height.

Thanks in advance,

My code is below:

     private void SetupForm() 
        { 
            try 
            { 
                // Add the events 
                this.radGridViewExceptions.ViewCellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(radGridViewExceptions_ViewCellFormatting); 
                this.radGridViewExceptions.DataSource = m_objExceptions.GetLast30DaysExceptions(); 
               
                // Wrapping text only seems to work correctly if this is not commented out
                // and I do not set the column widths below
                // this.radGridViewExceptions.MasterGridViewTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; 
               
                this.radGridViewExceptions.MasterGridViewTemplate.AllowColumnReorder = false
                this.radGridViewExceptions.MasterGridViewTemplate.AllowColumnResize = false
                this.radGridViewExceptions.AutoSizeRows = true
 
                // Format the columns 
                foreach (GridViewColumn column in radGridViewExceptions.Columns) 
                { 
                    switch (column.HeaderText) 
                    { 
                        case "When_Occured": 
                        case "Description": 
                            column.Width = 200
                            break; 
 
                        case "App_Assembly": 
                            column.Width = 120
                            break; 
 
                        case "App_Assembly_Version": 
                            column.Width = 150
                            break; 
 
                        default: 
                            column.Width = 100
                            break; 
                    } 
 
                    column.WrapText = true; //radCheckBoxShowFullText.Checked; 
                } 
                m_bFormLoaded = true
            } 
            catch (Exception ex) 
            { 
                ShowException(ex); 
                m_bFormLoaded = false
            } 
        } 
 

 


Victor
Telerik team
 answered on 03 Jul 2009
1 answer
209 views
Hi

I'm on a tight schedule and have put many hours of work into a usercontrol that does a bunch of stuff, automatic syntax highlighting based on list and db lookups, validation as you type and so on and so forth.

I did all of this on the assumption that, like the control set I worked with in my previous job, the Telerik Grid would provide some means of created a custom column that used my control.

However, having started work on the actual grid, I can find no way of doing this. After my initial efforts bore no fruit I searched extensively for ways of doing it both here and elsewhere on the Web and found nothing.

The code fragments I have found all require that one uses a class that is inherited from RadElement. Since the control I have, which represents many hours of work, is already written and I'm on a tight schedule, I _don't_ want to rewrite the whole thing from scratch based on a RadElement derived control. And C# doesn't allow multiple inheritance.

So the only thing I can think of is to somehow wrap my usercontrol in a class inherited from RadElement. My assumption is that it is possible to override certain painting and editing events inherited from the RadElement class so that they present my usercontrol. But the documentation of RadElement's members is kinda minimal - auto-documented code minimal. There's no explanation of what any of the events or functions are FOR, just descriptions of their signatures.

Is what I'm attempting possible? If so, how do I proceed?

Thanks in anticipation :)
Jack
Telerik team
 answered on 03 Jul 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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
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?