Telerik Forums
UI for WinForms Forum
3 answers
326 views

Hi,

I need to localize the winforms rad grid view control and used the source code displayed on the following page to set up the initial localization

http://docs.telerik.com/devtools/winforms/gridview/localization/localization

There's a lot of strings in there and obviously I don't know which functions and parts of the grid trigger many of the strings but from my very brief experience

1) The "RadGridStringId.NoDataText: return "No data to display";" case statement isn't called.

2) If I activate the RadGridLocalizationProvider then the search box on the top left of the grid displays "SearchRowTextBoxNullText". If I don't activate the localization provider then the search box displays "Enter text to search".

3) Looking at the code in the telerik document linked to above there's many strings returned that appear to be variable names rather than string. SearchRowTextBoxNullText is one example, but almost all the case statements beginning with "SearchRow...." appear to be variable names. The same with some of the "ConditionalFormattingPropertyGrid..." case statements.

I did a dumb copy and conversion to return strings held in my resx files, but felt very uncomfortable about the strings that don't appear to be real english words.

I can't plug this into production code until Im sure there's no problems and that Im understanding how it works.

Can you help please.
Hristo
Telerik team
 answered on 16 Jun 2017
6 answers
311 views

Hello.  I'm trying to style a series spline to have a thin borderwidth to set it apart from the other splines on the chartview, but no matter what value I set the BorderWidth property to, the spline is the same thickness.  Intellisense for BorderWidth mentions that BorderBoxStyle.FourBorders must be used, and the series is normally in SingleBorder, but setting it to FourBorders also didn't help.  I also tried to set the BorderDashStyle to dashes, just to see if other property changes would be respected, but the line is still solid.  The BorderColor and Spline properties appear to be respected.  Any ideas what I'm doing wrong?

Here's the code to create and add the series, as well as a screenshot of the chart.  The series in question is to the top (high) red spline.

Thanks!

 

    ScatterLineSeries x3PriceEnvelopeHighSeries = new ScatterLineSeries();
                        x3PriceEnvelopeHighSeries.XValueMember = "FaceWeight";
                        x3PriceEnvelopeHighSeries.YValueMember = "x3Price";
                        x3PriceEnvelopeHighSeries.DataSource = curvePointsHigh;
                        x3PriceEnvelopeHighSeries.BorderColor = Color.Red;
                        x3PriceEnvelopeHighSeries.BackColor = Color.Red;
                        x3PriceEnvelopeHighSeries.ShowLabels = false;
                        x3PriceEnvelopeHighSeries.Spline = true;
                        //x3PriceEnvelopeHighSeries.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders;
                        x3PriceEnvelopeHighSeries.BorderWidth = (float)0.25;
                        //x3PriceEnvelopeHighSeries.BorderLeftWidth = (float)0.25;
                        //x3PriceEnvelopeHighSeries.BorderTopWidth = (float)0.0;
                        //x3PriceEnvelopeHighSeries.BorderRightWidth = (float)0.0;
                        //x3PriceEnvelopeHighSeries.BorderBottomWidth = (float)0.0;
                        x3PriceEnvelopeHighSeries.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
                        chart.Series.Add(x3PriceEnvelopeHighSeries);
                        x3PriceEnvelopeHighSeries.IsVisibleInLegend = false;

Hristo
Telerik team
 answered on 16 Jun 2017
7 answers
314 views

Dear, apologies for the case since I find myself using the google translate.

I'm trying to export information from a gridview by adding to this headers and footer at the time of launching the xlsx, so following the thread http://docs.telerik.com/devtools/winforms/gridview/exporting-data/how -to / add-header-and-footer-to-the-exported-document, I have not been able to do it.

Attached code, please give me a hand. Thank you

 

Private Sub cmdExportarGestion_Click(sender As System.Object, e As System.EventArgs) Handles cmdExportarGestion.Click
        'Try
 
 
        Dim sfd As New FolderBrowserDialog()
        Dim ret As DialogResult
 
        With sfd
            .Reset()
            .Description = " Seleccionar una carpeta "
            .SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
            .ShowNewFolderButton = False
            ret = .ShowDialog()
        End With
 
        If ret = Windows.Forms.DialogResult.OK Then
            gbGeneral.Enabled = False
            Me.Cursor = Cursors.WaitCursor
            'For Each item In cboVendedores.Items
            'CargarFDetallePorcentaje(dgExportar, cboGestiones.Text, item("CODIGO").ToString)
            CargarFDetallePorcentaje(dgExportar, cboGestiones.Text, cboVendedores.Text)
            Select Case chkCabeceras.CheckState
                Case CheckState.Checked
                    Dim spreadExporter As New GridViewSpreadExport(dgMaestroDetalle)
                    Dim exportRenderer As New SpreadExportRenderer()
                    AddHandler exportRenderer.WorkbookCreated, AddressOf exportRenderer.CreateWorkbook
                    spreadExporter.SheetName = "COMISION VENDEDOR 05"
                    spreadExporter.RunExport(sfd.SelectedPath & "\123.xlsx", exportRenderer)
 
                    Dim solidPatternFill As New PatternFill(PatternType.Solid, System.Windows.Media.Color.FromRgb(46, 204, 113), Colors.Transparent)
                    Dim textFormat As New CellValueFormat("@")
 
 
                    Dim workbook As New Workbook()
                    'Dim worksheet As Worksheet = workbook.Worksheets.Add("COMISION")
 
 
 
 
                    Dim worksheet As Worksheet = workbook.Sheets.Add(0) 'TryCast(workbook.Sheets(0), Worksheet)
                    Dim range As New CellRange(0, 0, 1, dgMaestroDetalle.Columns.Count - 4)
                    Dim header As CellSelection = worksheet.Cells(range)
                    If header.CanInsertOrRemove(range, ShiftType.Down) Then
                        header.Insert(InsertShiftType.Down)
                    End If
                    header.Merge()
                    header.SetFormat(textFormat)
                    header.SetHorizontalAlignment(Telerik.WinControls.UI.RadHorizontalAlignment.Center)
                    header.SetVerticalAlignment(Telerik.WinControls.UI.RadVerticalAlignment.Center)
                    header.SetFontFamily(New ThemableFontFamily("Rockwell"))
                    header.SetFontSize(24)
                    header.SetFill(solidPatternFill)
                    header.SetValue("Nortwind Products Details")
 
 
                Case CheckState.Unchecked
                    'Dim spreadExporter As New ExportToExcelML(dgMaestroDetalle)
                    'spreadExporter.ExportHierarchy = True
                    'spreadExporter.ExportVisualSettings = True
                    'spreadExporter.RunExport(sfd.SelectedPath & "\Gestion_" & cboGestiones.Text & "_Vendedor_" & item("CODIGO").ToString & ".xls")
            End Select
 
            'Next
        Else
            Exit Sub
        End If
        Me.Cursor = Cursors.Default
        sfd.Dispose()
        MsgBox("Exportacion exitosa..", MsgBoxStyle.Information, MsgboxTitle)
        gbGeneral.Enabled = True
        'Catch ex As Exception
        '    MsgBox(ex.Message, MsgBoxStyle.Critical, MsgboxError)
        'End Try
    End Sub
End Class
Dimitar
Telerik team
 answered on 16 Jun 2017
7 answers
291 views
I need to modify the style of the group header but can't seem to do it. I can modify the font, but it also seems to modify the font of the appointments as well.
Dim SchedElement As SchedulerDayViewGroupedByResourceElement = RadScheduler1.GetDayView.Scheduler.SchedulerElement.ViewElement
SchedElement.Font = New Font("Segoe UI", 10, FontStyle.Regular, GraphicsUnit.Point)
SchedElement.ForeColor = Color.White
SchedElement.ResourceHeaderHeight = 35
SchedElement.ResourcesHeader.BackColor = Color.FromArgb(0, 159, 60)
SchedElement.ResourcesHeader.BackColor2 = Color.FromArgb(0, 159, 60)
 
Anything that sets a "ResourceHeader" doesn't seem to do what I am expecting. The attached picture shows the header I am trying to modify as well as what RadControlSpy says about it.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Jun 2017
7 answers
1.0K+ views

I have a gridview with a gridviewcheckboxcolumn and an enabled headercheckbox as well.  I have Excel type filters enabled along with grouping.  What I want to do is get a running count of how many items are checked (say out of 1,000).

Currently I am using a loop to get the checked cells by iterating through the RadGrid.MasterTemplate.DataView.ItemCount and checking each row checkbox value.  This works ok, but where I have a problem is with the header check/uncheck all button.  When I check the header button it will trigger the CellValueChanged event every time a cell changes.  For 1,000 records this gets pretty slow.

So my questions are;

  1. Is there a CheckedCount method instead of iterating?  would have to work on Excel filtered grid
  2. Is there a way to 'wait' for the header toggle to finish so that the CellValueChanged could be set not to trigger until done?
  3. Is there a simpler, better way to get a count of Checked rows in a grid?
Private Sub grdSales_CellValueChanged(sender As Object, e As GridViewCellEventArgs) Handles grdSales.CellValueChanged
    'count checked rows, enable process, set label
    If e.ColumnIndex > 0 Then Return    'only want checked col [0]
    Dim iCnt As Integer = fCountCheckedRows()
    btnProcess.Enabled = iCnt > 0
    lblCheckedRecords.Text = CStr(lblCheckedRecords.Tag) & iCnt
End Sub
 
Private Function fCountCheckedRows() As Integer
    Dim iCount As Integer = 0
    For i = 0 To grdSales.MasterTemplate.DataView.ItemCount - 1
        If Not IsDBNull(grdSales.Rows(i).Cells(0).Value) Then
            If grdSales.Rows(i).Cells(0).Value = True Then iCount += 1
        End If
    Next
    Return iCount
End Function
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Jun 2017
2 answers
186 views

In VB.net please,

 

I need to open the default edit form for a an appointment in MyRadScheduler.Appointments, so I just need to simulate the double click on an appointment, but using only code.

Bassel
Top achievements
Rank 1
 answered on 14 Jun 2017
3 answers
615 views
Hello

Help me!

I have a RadSplitContainer, on RadSplitContainer located 5 splitPanels.
When the program starts user resizes on RadSplitContainer, splitPanels.

How can i save the settings, that are made by the user?
Dimitar
Telerik team
 answered on 14 Jun 2017
7 answers
1.3K+ views

I have an application with multiple PDF viewers and the user can switch between the viewers on demand.

When switching between viewers I do the following:

  • Reset the viewer by displaying a dummy document (so that the previous PDF is no longer visible and so that a template, etc. could be displayed as a placeholder if something goes wrong - previous developer's choice). This is done by calling LoadDocument() with the placeholder's physical file path
  • I then do a bunch of things and get the new desired content as a MemoryStream from the database and load it. This is done by calling LoadDocument() with the MemoryStream variable

When this happens, the content of the MemoryStream is not displayed, instead only the placeholder content is shown. It's as though the load of the MemoryStream was never loaded (but I have confirmed that line of code is always reached).

If I remove the placeholder code so that I'm only working with a MemoryStream then it works correctly.

Calling UnloadDocument() before loading from the MemoryStream has no effect.

What can be done to fix this?

Dimitar
Telerik team
 answered on 13 Jun 2017
1 answer
433 views

How can I limit the length of characters user can enter on a particular gridview column?

I tried this code but I got an error saying that there is no definition for MaxLength?

 

void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)     
{     
    if (e.ColumnIndex == 1)  
    {  
        if (e.Column is GridViewTextBoxColumn)     
        {     
            ((RadTextBoxEditorElement)((RadTextBoxEditor)this.radGridView1.ActiveEditor).EditorElement).MaxLength = 30;     
        }     
    }  
} 

Dimitar
Telerik team
 answered on 13 Jun 2017
29 answers
697 views

I am new to Telerik controls and am attempting setting up a Scheduler control on a windows form. I have followed the web based sample and am attempting to bind to your sql based sample data using as the ScheduleBindingDataSource data setting the settings as your sample

Does the datasource need to be initiated when the form loads as I am returning no records?

 

ResourceProvide

Allownew         True

Datamember      Appointments

DataSource         SchedulerDataDataSet

 

If I comment out the if statement in the data binding event and force a new instance of the SchedulerDataDataSet then the records are returned!

 

'If Me.SchedulerDataDataSet Is Nothing Then

            Me.SchedulerDataDataSet = New SchedulerDataDataSet()

 

            Dim appointmentsAdapter As New AppointmentsTableAdapter()

            appointmentsAdapter.Fill(Me.SchedulerDataDataSet.Appointments)

 

            Dim resourcesAdapter As New ResourcesTableAdapter()

            resourcesAdapter.Fill(Me.SchedulerDataDataSet.Resources)

 

            Dim appointmentsResourcesAdapter As New TransientAppointmentsResourcesTableAdapter()

            appointmentsResourcesAdapter.Fill(Me.SchedulerDataDataSet.TransientAppointmentsResources)

            ' End If

Alejandro
Top achievements
Rank 1
 answered on 12 Jun 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?