Telerik Forums
UI for WinForms Forum
4 answers
613 views
Hello,
I need to add the background highlight for grid row(s), please help me to implement it!
Thanks
Paul
Top achievements
Rank 1
 answered on 16 Oct 2017
3 answers
162 views

Hello,

One of RadMenuItem constructors is new RadMenuItem("TEXT", object Tag)..
How do I retrieve that Tag value in code?

Thanks

Роберт
Top achievements
Rank 1
 answered on 14 Oct 2017
5 answers
4.0K+ views
I am new to Telerik Winforms/ASP toolkit.  I have been previously using infragistics.  I am trying to hide a column in a gridview after I send a datatable to the datasource of the grid.  I am trying to find a visible property of the column, but unable to do so.  All the posts I have seen show that you have to loop through the entire grid setting the cell's visible property to false. 

Is there an easy way to do the following or do I really have to loop through the entire grid?

RadGridView1.Columns("id").visible = false 
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Oct 2017
1 answer
315 views
I am using a RadLayoutControl and I would like show a RadStatusStrip with a progressbar at the bottom of the form while loading data into the forms RadGridView. I want the status strip to go away when loading has finished though and I expect the grid to resize properly when addingthe status strip and when removing it. How can I accomplish this?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Oct 2017
1 answer
406 views

I have a grid that is populated from a BindingList (I am working with the EntityFramework)

The CellValueChanged event does apply the changes to the underlying database

But When I add a new row, the UserAddedRow (which is fired) does not add the row to the underlying database (and does not generate an error)

Despite long hours of research I have not found the solution to add a new row to my table by typing it's value in the "New Row" of the grid

Thanks in advance

The code snipet:

'Populate the Grid
 Dim mArena As New mArena(context)
        Dim allArenas As BindingList(Of Arena) = mArena.GetArenasByShowId(idShow)
        gvArena.AutoGenerateColumns = True
        gvArena.DataSource = allArenas

   Public Function GetArenasByShowId(ByVal idShow As Integer) As BindingList(Of Arena)
        Try
            Dim Query = (From aArena As Arena In context.Arenas
                         Where aArena.idShow = idShow
                         Order By aArena.Name)
            Return New BindingList(Of Arena)(Query.ToList())
        Catch ex As Exception
            RaiseEvent msg("F", ex.Message)
            Return Nothing
        End Try
    End Function

'Grid Events
    Private Sub gvArena_CellValueChanged(sender As Object, e As GridViewCellEventArgs) Handles gvArena.CellValueChanged
        Try
            context.SaveChanges()
        Catch ex As Exception
            RaiseEvent msg("F", "CellValueChanged: " & ex.Message)
        End Try
    End Sub

    Private Sub gvArena_UserAddedRow(sender As Object, e As GridViewRowEventArgs) Handles gvArena.UserAddedRow
        Try
            gvArena.EndEdit()
            context.SaveChanges()
        Catch ex As Exception
            RaiseEvent msg("F", "AddedRow: " & ex.Message)
        End Try
    End Sub

Dimitar
Telerik team
 answered on 13 Oct 2017
2 answers
386 views

Hello,

Is there a way to implement conditional formatting of rows of RadMultiColumnComboBox or set back color of its row depending on a condition while row is added (the control is unbound)?

Thanks

Wojciech

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Oct 2017
3 answers
416 views

Hi,

when I add a ribbon to a form, it automatically contains a titlebar with minimize/maximize/close buttons.

However, I would like for the form to continue using the default form one, rather than the one in the ribbon control (as I have no need for the quick menu in my app).

How do I go about hiding the titlebar of the ribbon control?

Regards,

Thomas

 

Dimitar
Telerik team
 answered on 12 Oct 2017
1 answer
426 views
Hi

I am getting the data from sql and i want to show in the grid as per excel attached.

It is urget, i am evaluating the radgridview, could not getting the solution.

Regards

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Oct 2017
3 answers
401 views
In my Windows forms application I'm using GetLocationFromViewPoint method to get the coordinates when drawing a rectangle on the Pdf file.Again when I'm loading the same Pdf I need to draw the rectangle using the coordinates defined in the earlier case. But when drawing the rectangle the Y coordinate is incorrrectly drawn. The problem here is I'm using the RadFixedPageElement positions for the GetLocationFromViewPoint method and Now I need to get the RadPdfViewerElement coordinates to draw the rectangle in correct position. Is there any way to get this done ? Please help.
Hristo
Telerik team
 answered on 12 Oct 2017
8 answers
957 views
Hi,

I've put a custom checkbox in the header in order to select/unselect all row's checkbox. I use this code:

public class CheckBoxHeaderCell : GridHeaderCellElement 
    { 
        RadCheckBoxElement checkbox; 
 
        public CheckBoxHeaderCell(GridViewColumn column, GridRowElement row) 
            : base(column, row) 
        { 
        } 
 
        protected override void DisposeManagedResources() 
        { 
            checkbox.ToggleStateChanged -= new StateChangedEventHandler(checkbox_ToggleStateChanged); 
            base.DisposeManagedResources(); 
        } 
 
 
        protected override void CreateChildElements() 
        { 
            base.CreateChildElements(); 
            checkbox = new RadCheckBoxElement(); 
            checkbox.ToggleStateChanged += new StateChangedEventHandler(checkbox_ToggleStateChanged); 
            this.Children.Add(checkbox); 
            ApplyThemeToElement(checkbox, "ControlDefault"); 
        } 
 
        protected override SizeF ArrangeOverride(SizeF finalSize) 
        { 
            base.ArrangeOverride(finalSize); 
            if (checkbox != null) 
            { 
                RectangleF rect = GetClientRectangle(finalSize); 
                checkbox.Arrange(new RectangleF(rect.Right - 20, (rect.Height - 20) / 2, 20, 20)); 
            } 
            return finalSize; 
        } 
 
        private void checkbox_ToggleStateChanged(object sender, StateChangedEventArgs args) 
        { 
            this.GridControl.BeginEdit();                   
            for (int i = 0; i < this.GridControl.Rows.Count; i++) 
            { 
                this.GridControl.Rows[i].IsSelected = true; 
                this.GridControl.Rows[i].IsCurrent = true;                 
                this.GridControl.Rows[i].Cells["Mostrar"].Value = this.checkbox.IsChecked; 
            } 
            this.GridControl.EndEdit(); 
        } 
 
        private void ApplyThemeToElement(RadItem item, string themeName) 
        { 
            DefaultStyleBuilder builder = ThemeResolutionService.GetStyleSheetBuilder((RadControl)item.ElementTree.Control, 
                item.GetThemeEffectiveType().FullName, string.Empty, themeName) as DefaultStyleBuilder; 
 
            if (builder != null) 
            { 
                item.Style = new XmlStyleSheet(builder.Style).GetStyleSheet(); 
            } 
        } 
    }  

and:

 private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e) 
        { 
            if (e.Row is GridTableHeaderRowElement && e.Column.HeaderText == "Mostrar") 
            { 
                e.CellElement = new SMPDataAnalyzer.TelerikHeaderGrid.CheckBoxHeaderCell(e.Column, e.Row); 
            }  
        } 


This works fine. But the problem is the following:

I have to detect when the row's checkbox value is change to true or false. I use the ValueChanged event :
private void radGridView1_ValueChanged(object sender, EventArgs e) 
        { 
            try 
            { 
                if (this.radGridView1.ActiveEditor is RadCheckBoxEditor) 
                { 
                    if (radGridView1.CurrentRow.Tag != null) 
                    { 
                        if ((bool)(this.radGridView1.ActiveEditor.Value) && !tendencias.ContainsKey(Convert.ToInt32(radGridView1.CurrentRow.Tag))) 
                        { 
                            if (radGridView1.SelectedRows.Count > 0) 
                            { 
                                medidastendencia = Controller.CargarValoresMedidas 
                                    (long.Parse(radGridView1.CurrentRow.Cells["PuntoId"].Value.ToString()), 
                                    fechaIni, fechaFin, 
                                    long.Parse(radGridView1.SelectedRows[0].Cells["TipoEspectro"].Value.ToString()), 
                                    long.Parse(radGridView1.SelectedRows[0].Cells["Nbanda"].Value.ToString())); 
 
                                if (medidastendencia.Count > 0) 
                                { 
                                    ScatterPlot scatterPlot = new ScatterPlot(); 
                                    scatterPlot.XAxis = xAxis2; 
                                    scatterPlot.YAxis = yAxis2; 
                                    scatterPlot.Tag = Convert.ToInt32(radGridView1.CurrentRow.Tag); 
                                    scatterGraphTendencias.Plots.Add(scatterPlot); 
                                    int i = 0; 
                                    double[] fechas = new double[medidastendencia.Count]; 
                                    double[] values = new double[medidastendencia.Count]; 
                                    foreach (MedidaTendencia mt in medidastendencia) 
                                    { 
                                        fechas[i] = (Double)(DataConverter.Convert(mt.FechaMedida, typeof(Double))); 
                                        values[i] = mt.Valor; 
                                        i++; 
                                    } 
                                    scatterPlot.PlotXY(fechas, values); 
                                    xyCursor2.Plot = scatterPlot; 
                                    xyCursor2.SnapMode = CursorSnapMode.NearestPoint; 
                                    xyCursor2.MoveNext(); 
                                    xyCursor2.MovePrevious(); 
                                    xyCursor2.Visible = true; 
                                    if (!isTendenciaVisible) 
                                    { 
                                        isTendenciaVisible = true; 
                                        activeTend(); 
                                    } 
                                    tendencias.Add(Convert.ToInt32(radGridView1.CurrentRow.Tag), values); 
                                } 
                                else 
                                { 
                                    MessageBox.Show(Properties.Resources.ERROR_MEDIDAS_TEND); 
                                } 
                            } 
                        } 
                        else 
                        { 
                            //Se ha puesto a false 
                            if (tendencias.ContainsKey(Convert.ToInt32(radGridView1.CurrentRow.Tag))) 
                            { 
                                int i = 0; 
                                foreach (ScatterPlot plot in scatterGraphTendencias.Plots) 
                                { 
                                    if (plot.Tag.ToString() == radGridView1.CurrentRow.Tag.ToString()) 
                                    { 
                                        if (i > 1) 
                                        { 
                                            xyCursor2.Plot = scatterGraphTendencias.Plots[i - 1]; 
                                            xyCursor2.MoveNext(); 
                                            xyCursor2.MovePrevious(); 
                                        } 
                                        else 
                                        { 
                                            if (scatterGraphTendencias.Plots.Count > 2) 
                                            { 
                                                xyCursor2.Plot = scatterGraphTendencias.Plots[i + 1]; 
                                                xyCursor2.MoveNext(); 
                                                xyCursor2.MovePrevious(); 
                                            } 
                                            else 
                                            { 
                                                xyCursor2.Plot = scatterPlot2; 
                                                xyCursor2.Visible = false; 
 
                                                desactiveTend(); 
                                            } 
                                        } 
                                        scatterGraphTendencias.Plots.Remove(plot); 
                                        plot.Dispose(); 
                                        break; 
                                    } 
                                    i++; 
                                } 
                                tendencias.Remove(Convert.ToInt32(radGridView1.CurrentRow.Tag)); 
                            } 
                        } 
                    } 
                } 
            } 
            catch (Exception ex) 
            { 
                string message = ex.Message; 
            } 
        } 


But..., when I use the header checkbox in order to select/unselect all,the ActiveEditor property is null.

¿How do I this?

Thank you,

Fernan,
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Oct 2017
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
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?