Telerik Forums
UI for WinForms Forum
11 answers
396 views

Need some help here...

I'm exporting a RadDataGrid to CSV but get the 'object reference to instance of an object' error. Every time i have a empty *.csv doc and the csvExporter.RunExport crashes...

Changing it to an Excel exporter makes it work fine.

code:

Dim exportGridView As New Telerik.WinControls.UI.RadGridView
 exportGridView.DataSource = rep.GetObjectCorrespondentieGegevens(projectId)
Public Function GetObjectCorrespondentieGegevens(ByVal id As Integer) As Object Implements     ICorrespondentieRepository.GetObjectCorrespondentieGegevens
           Dim model = From p In _db.tblAannemers.AsEnumerable() _
                       Select p.fldAannemerNaam
           Return model
       End Function
Private Shared Sub RunExportToCSV(ByVal fileName As String, ByRef gridView As RadGridView)
           Dim csvExporter As ExportToCSV = New ExportToCSV(gridView)
           'csvExporter.FileExtension = "txt"
           'csvExporter.SummariesExportOption = SummariesOption.ExportAll
           Try
               'csvExporter.
               csvExporter.SummariesExportOption = SummariesOption.DoNotExport
               csvExporter.RunExport(fileName) ' this is where the exception happens :-(
           Catch ex As Exception
           End Try
       End Sub
Martin Vasilev
Telerik team
 answered on 15 Mar 2011
1 answer
115 views
Hi,
I'm probably doing something wrong. But I have not find any help in documentation and in the demos.
When I prepare commandbar visually in designer, I'm able to move strips to correct order.
But how to do this in code?
I merge two commandbars together, so I add the strip to the commandCarRow, but in soe cases this second strip is displayed before the original first. And I have no clue why?
commandBarChild.Rows[0].Strips.Add(strip);
Thanks for any idea, as I said I didn't find any help in documentation or demos for that. If there is something about it, jsut point me there, please.
Ivan Todorov
Telerik team
 answered on 15 Mar 2011
3 answers
141 views
Hello

    How can I change the properties from a RadButtonElement from another thread ?

        HervĂ©

Ivan Petrov
Telerik team
 answered on 15 Mar 2011
3 answers
258 views
I am needing to display some text on my form which has some older HTML tags, e.g. FONT, and other HTML tags.  

The radlabel does not display the HTML properly even when wrapped in "<HTML>".  However, if I set the value of the radmarkupeditor to the HTML, it is displayed properly.  In fact, when I hit APPLY, it actually converts the older tags to more compliant versions, ala SPAN tags with STYLE attributes.

How can I get the label to display the HTML properly?  Or which control does the radmarkupeditor take advantage of?  Or can I call the internal "convert" method somehow?

Please advise!
Peter
Telerik team
 answered on 15 Mar 2011
3 answers
129 views
Hello Everybody,

How to restrict users to leave from one radForm to other before completing a certain process in radDock. I tried to apply some logic on radDock_ActiveWindowChanged event but its not restraining it to change. Following code I wrote in radDock changed event.

((HostWindow)(this.radDock1.DockWindows(radDock1.ActiveWindow.Name + "1"))).Select();    
((DocumentWindow)(this.RadDock1.DockWindows(windowName))).Select();

Thanks,
Saad

Richard Slade
Top achievements
Rank 2
 answered on 15 Mar 2011
1 answer
164 views
If you don't like the way the RadGridView adds the Filter text (e.g. Contains, Equals, etc) in the Filter row, you can use this code that I wrote.  The text is unreadable in skinnier columns.  Plus, it confused my users since clicking on the word "Contains" did not automatically allow them to start typing; they had to click next to the word.

Anyways, this code simply collapses the text element and adds a tooltip to the filter row's cell and button.
Private Sub RadGridView1_ToolTipTextNeeded(ByVal sender As Object, ByVal e As Telerik.WinControls.ToolTipTextNeededEventArgs) Handles RadGridView1.ToolTipTextNeeded
    If TryCast(sender, GridFilterCellElement) IsNot Nothing Then
        e.ToolTipText = CType(sender, GridCellElement).ToolTipText
    End If
End Sub
 
Private Sub RadGridView1_ViewCellFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.ViewCellFormatting
    HideFilterText(e.CellElement)
End Sub
 
 
Friend Sub HideFilterText(ByVal CellElement As GridCellElement)
    Dim oFilterCellElement As GridFilterCellElement
    Try
        If TryCast(CellElement, GridFilterCellElement) IsNot Nothing Then
            oFilterCellElement = CType(CellElement, GridFilterCellElement)
            oFilterCellElement.ToolTipText = oFilterCellElement.FilterOperatorText.Text.Replace(":", "")
            oFilterCellElement.FilterButton.ToolTipText = oFilterCellElement.FilterOperatorText.Text.Replace(":", "")
            oFilterCellElement.FilterOperatorText.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        End If
    Catch ex As Exception
        ' Do nothing
    End Try
 
End Sub


I now use this on all my grids within my current project.  It would be nice if something similar was built in.  If it is already, then I've missed it in the documentation.

Feel free to offer code improvements or another way.
Emanuel Varga
Top achievements
Rank 1
 answered on 15 Mar 2011
1 answer
129 views
Hi, I'm having an issue refreshing the data in my treeview.  Here is the treeview.

'Build Tree View
Private Sub BuildtvOrgan()
    tvOrgan.RelationBindings.Add(New RelationBinding("CompanyDepts", Me.DepartmentBindingSource))
    tvOrgan.RelationBindings.Add(New RelationBinding("Department_Employee", Me.EmployeeBindingSource))
    tvOrgan.RelationBindings.Item(0).DisplayMember = "DeptName"
    tvOrgan.RelationBindings.Item(0).ValueMember = "id"
    tvOrgan.RelationBindings.Item(0).DataSource = DepartmentBindingSource
    tvOrgan.RelationBindings.Item(1).DisplayMember = "FName"
    tvOrgan.RelationBindings.Item(1).ValueMember = "id"
    tvOrgan.RelationBindings.Item(1).DataSource = EmployeeBindingSource
    tvOrgan.DataSource = CompanyBindingSource
    tvOrgan.ValueMember = "id"
    SetImages(tvOrgan.Nodes)
    tvOrgan.ExpandAll()
End Sub

Now, when I modify the underlying data the treeview doesn't change.  It does change if I add data to the underlying tables.  If I add a new Company.Department.Employee to the datatables the treeview updates, with an expandall().  However if I change department A to now be in department C instead of B it doesn't move until I reload the app.  Any idea's anyone?  How can I get the treeview to show changes made to the datasource.

Thanks
Nick Jones
Top achievements
Rank 1
 answered on 15 Mar 2011
2 answers
113 views
Is it possible to replace the appointment window with a custom window where you will have full control?

Best R, Thomas
Richard Slade
Top achievements
Rank 2
 answered on 15 Mar 2011
2 answers
130 views
Hi Team,

I m using  radchart control in my project. 
i m drawing real time chart . my Y axis AutoScale =True
But when i m setting the y axis as max of y axis scale, it is hideing the series line.
How i can give a margin for Max values?

Please refer the attachment.



Thanks and Regards
Saurabh dubey
saurabh(GV433015)
Top achievements
Rank 1
 answered on 15 Mar 2011
5 answers
162 views
Hello, telerik community :)

While using the color blending mechanism, I noticed that if a rad control is created for the first time after the color blending takes place, that control will not have the blending changes.
In my application, as soon as I open the main form, I apply a theme and then a color blending.

If m_Theme = AvailableThemes.ControlDefault Then
    m_CurrentTheme = Telerik.WinControls.ThemeResolutionService.GetTheme("ControlDefault")
    name = "ControlDefault"
Else
    If Not ThemeLoaded(name) Then
        ThemeResolutionService.LoadPackageResource(name & ".tssp")
    End If
End If
             
m_CurrentTheme = Telerik.WinControls.ThemeResolutionService.GetTheme(name)
Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = name
m_CurrentTheme.AddColorBlend(blend.Name, blend.BaseHslColor)
m_CurrentTheme.ThemeProperties(blend.Name) = blend.BlendHslColor

AvailableThemes is an enumeration of theme names. All other themes except ControlDefault are assembly Resources (tssp files).

As soon as the main window of the application is shown, my theme "manager" loads the last used theme and applies a color blending to that theme.

It seems that rad controls, which are not loaded before the color blend, will not get the new colors. RadPageView is even worse, even if it is loaded (in my case, my main form has a RadPageView in stack viewmode), it will only apply the color blending to new RadPageViews of the same view mode (strip or stack).

To successfully apply color bindings in controls that will be created after the initial color blending, I have to add dummy controls (for example, a RadPageView with view mode strip) on my main form's control collection (with size 0,0 show that these controls don't show up) and after the application of color blending, I remove them.

Is this the desired functionality? I thought that color blending would be available to all controls using the theme that has the color blending.

Forgot to mention that I am using the latest dev release of RadControls for WinForms Q3 2010 (2010.3.10.1326).
Dobry Zranchev
Telerik team
 answered on 15 Mar 2011
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?