Telerik Forums
UI for WinForms Forum
7 answers
1.5K+ views

Hi- I'm having trouble with exporting grid contents to Excel- using winforms radgridview version 2018.1.220.40 in vb.net.  (Hopefully this is a stupid question but I've spent an hour looking through documentation and I think I'm missing something.)  I found the code snippet below in the documentation, but getting the error 

gridViewExport is not defined, and gridviewExportOptions not defined...  

I'm assuming that gridViewExport is supposed to be my radgridview object, but when I sub in the name of mine, it says 'export' is not a member of RadGridView... 

Can you advise?    Thanks very much. 

-----------------------------------------

https://docs.telerik.com/devtools/wpf/controls/radgridview/export/export

    Private Sub btnExport_Click(sender As Object, e As RoutedEventArgs)
        Dim extension As String = "xls"
        Dim dialog As New SaveFileDialog() With {
         .DefaultExt = extension,
         .Filter = String.Format("{1} files (.{0})|.{0}|All files (.)|.", extension, "Excel"),
         .FilterIndex = 1
        }
        If dialog.ShowDialog() = True Then
            Using stream As Stream = dialog.OpenFile()
                gridViewExport.Export(stream, New GridViewExportOptions() With {
                 .Format = ExportFormat.Html,
                 .ShowColumnHeaders = True,
                 .ShowColumnFooters = True,
                 .ShowGroupFooters = False
                })
            End Using
        End If
    End Sub

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Dec 2019
3 answers
164 views

Hello,

I have some issues with the MultiColumn ComboBox (in the following just CB) in Visual Studio, i'll show you some code steps:

 

step 1: init CB

With myCB
 
    .ClearTextOnValidation = True
    .DataBindings.Clear()
    .BestFitColumns()
    .ValueMember = "wpno"
    .DisplayMember = "wpno"
    .DataSource = myDataset.Tables("myTable")
    .AutoFilter = True
    .AutoCompleteMode = AutoCompleteMode.Append
 
    Dim compositeFilter As New CompositeFilterDescriptor()
    Dim selectField1 As New FilterDescriptor("fieldname1", FilterOperator.Contains, "")
    Dim selectField2 As New FilterDescriptor("fieldname2", FilterOperator.Contains, "")
    Dim selectField3 As New FilterDescriptor("fieldname3", FilterOperator.Contains, "")
    compositeFilter.FilterDescriptors.Add(selectField1)
    compositeFilter.FilterDescriptors.Add(selectField2)
    compositeFilter.FilterDescriptors.Add(selectField3)
    compositeFilter.LogicalOperator = FilterLogicalOperator.[Or]
 
    .EditorControl.FilterDescriptors.Clear()
    .EditorControl.FilterDescriptors.Add(compositeFilter)
 
    .ValueMember = "wpno"
    .DisplayMember = "wpno"
    .DataSource = myDataset.Tables("myTable")
 
End With

 

step 2: select an entry via the GUI or via

myCB.SelectedIndex = 2

works fine

 

step 3: open another form to edit some values of the selected entry

Me.Enabled = False
otherForm.Show()

 

step 4: Edit entry in other form, set a flag and return to first form (containing the CB)

updateEntry(updateField, updateValue)
updComboList = True
firstForm.Enabled = True
Me.Close()

 

step 5: reload values for the CB

If updComboList Then
    updateDataset()
    updateCB() 'code from step1
    CB.Enabled = True
    CB.SelectedIndex = 2 'doesn't work
End If

 

From now on, no change of selection via SelectedIndex or even via the GUI is possible! The CB is still responsive in terms of colors while hovering cells, but no selection is made when I click anywhere on the drop-down table of the CB. This table doesn't close again either.

 

Do you have any suggestions? Or is there maybe a bug with this MultiColumn ComboBox?

 

Thanks heaps.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Dec 2019
1 answer
1.8K+ views

C#, Winforms

I have an XML data source (Main) that I am binding to my gridview. I want one column to be a combobox. I'm using a separate XML file (Options) for the combobox options. 

Questions:

1) When I set the data source for the combobox to the Options dataset, the column is blank. I want it to be the value listed in the Main dataset. The result I seek is that when the grid loads, the values from the Main dataset are loaded. The user can then edit the combobox column by selecting from the drop down that is populated from the Options dataset. How can I achieve this?

2) Obviously, I want to save these back edits back to the main dataset. How can I rebind the column to the Main dataset?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Dec 2019
3 answers
1.1K+ views
Hi again!

How can I check if context menu is displayed?

I have a mouse_click event and if the user right clicks off a row (into white space) I display a custom popup. However, when the user right clicks on a row, the context menu pops up and then my menu pops up over top.

What i need to do is to determine whether the user right clicked on a row, or on white space so i can avoid showing my popup if they right clicked on a row.  

Thanks.


Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Dec 2019
2 answers
193 views

Hello,

Is there a simple way to get the selected appointment in agenda view?

Or is there a way to convert a AgendaAppointmentWrapper to an Appointment?

Grtz and thnxs

Patrick Vossen

Patrick
Top achievements
Rank 1
 answered on 29 Nov 2019
3 answers
559 views
Hi,

Is there a way to place a button inside of a textbox?

Here's my scenario:
A user has a textbox to enter words that they wish to search for. After they have searched and they want to clear the results, i want to have a button (a red x button or something) that shows up at the end of the textbox (inside the textbox) allow them to clear the textbox and search results.

I've tried making a RadButtonElement and adding it to the TextBoxElement.Children but the button appears to show up behind the textbox element. I can see and click on the very bottom edge of the textbox and fire the event handler.

        Dim btnElement As New RadButtonElement  
        btnElement.Text = "try this" 
        btnElement.Size = New Drawing.Size(20, 20)  
 
        Dim textboxElement As RadTextBoxElement = txtSearchFor.TextBoxElement  
 
        textboxElement.Children.Add(btnElement)  
        AddHandler btnElement.Click, AddressOf btnClearSearh_Click 

Thanks
Nadya | Tech Support Engineer
Telerik team
 answered on 29 Nov 2019
4 answers
397 views

I have gridview with string, date, and numeric columns.  Once I set the data source and fill with data, I format each column to a suitable display - eg: short date, 2 decimal places for some, 4 decimals for others, etc. using the column.formatstring.  

On a row click I need to get the formatted cell text, not the value and am wondering how I can do this?  Eg: the underlying value of a cell is 12345.670000 but is formatted and displayed in the cell as 12,345.67.  I could not find a "cell.text" property; and cell.value gives me the raw data.

How can I get the formatted cell text?  Thanks, Brendan

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Nov 2019
4 answers
258 views

Hello

I try to use the BrowseEditor in DialogType=FontFialog and I am faced with a few questions:

The value returned is a string ex: "Microsoft Sans Serif; 12pt; style=Bold"

1. How do I convert this string to a font type, taking into account that depending on the culture the size may be shown as 8,5 or 8.5

2. How do I set the initial value of the fonteditor from a fontvariable

4. Selecting "Modern 20, bold, size 8", I get the value: "Modern No. 20; 8,249999pt; style=Bold" (not that I want to use this font but I came across this anomality ,,,)

5. How do I change the initial text "(none)" in a localized text

 

And While I am on the BrowseEditor, in folderBrowseDialog, I select the intial directory on the .value property and it sets it properly but it is not always "visible" how can I insurevisible on the selected folder

 

Thanks in advance

Pierre-Jean

pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 28 Nov 2019
4 answers
286 views

Hello

in the FontDialog of the RadBrowseEditor is it possible to hide the three elements:
- Effects
- Sample
- Script

Thanks in advance

Pierre-Jean

pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 28 Nov 2019
5 answers
736 views

I need the right-click context, so setting the scheduler to readonly isn't an option.

I need to stop the scheduler showing the edit dialog when an appointment is double clicked... Any ideas?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Nov 2019
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?