Telerik Forums
UI for WinForms Forum
3 answers
165 views
Good morning,

after binding a collection (List) of custom object to a gridview (with no problem) i am using ExportToExcelML to export that grid in excel;

it does export only object's property of a "know" type..

Example 

class Car
{
public string Name ;
}


Class Customer
{
public string Name;
public Car Car{get;protected set;}
}

binding radgridview with a List<Customer> and exporting to excel will export just "Name" property and not "Car" , when in the gridview is shown correctly.
 is there any interface i need to implement in my classes? 

Thanks 

Nino
Stefan
Telerik team
 answered on 28 May 2013
7 answers
1.0K+ views
hi,

following events are not firing DragDrop, DragOver, DragEnter you will find the code below but it is trivial, all of this events are inhereted from microsoft components but still i would like them to fire.

Anyhow what I need is to check if i can drop node-draged to the one below and I need an event and possibility to change cursor or something like this. Is there a way for doing that ?

thanks

  radTreeView1.DragDrop += new DragEventHandler(radTreeView1_DragDrop);
            radTreeView1.DragEnter += new DragEventHandler(radTreeView1_DragEnter);
            radTreeView1.DragOver += new DragEventHandler(radTreeView1_DragOver);
  

void radTreeView1_DragDrop(object sender, DragEventArgs e)
        {
            Console.WriteLine("dragdrop ");
        }

        void radTreeView1_DragOver(object sender, DragEventArgs e)
        {
            Console.WriteLine("drag over");
        }

        void radTreeView1_DragEnter(object sender, DragEventArgs e)
        {
            Console.WriteLine("drag enter");

        }



Stefan
Telerik team
 answered on 28 May 2013
9 answers
288 views
Telerik,

I am trying to auto fix the casing if a tag is being entered that is already in the AutoCompleteItems list.  I am handling the CreateTextBlock event and keep getting an  object reference not set to an instance of an object. error when trying to create the new TokenizedTextBlockElement.

Maybe there is a better way ?

Private Sub RadAutoCompleteBox_CreateTextBlock(sender As Object, e As CreateTextBlockEventArgs)
 
    If TypeOf e.TextBlock Is TokenizedTextBlockElement Then
        For Each item As RadListDataItem In RadAutoCompleteBox1.AutoCompleteItems
            If item.Text.ToLower = e.Text.ToLower Then
                e.TextBlock = New TokenizedTextBlockElement(item.Text)
                Exit For
            End If
        Next
    End If
 
End Sub

Peter
Telerik team
 answered on 27 May 2013
3 answers
170 views
Telerik,

I am using a few different control suites and am experiencing the following behavior with the RadAutoCompleteBox and a winforms button control.

Steps to reproduce.

1) Drop a RadAutoCompleteBox control on a form.
2) Drop a regular windows form button on the same form.
3) Have the text of the button be &Save and add a message box behind the button.
4) Run the application and press s in the radautocompletebox.

You will notice that the message box is being called.  One of the other control toolkits that we are using is inheriting  the windows controls.  This behavior does not happen when a RadButton is used.  However, this is not a acceptable workaround for us.

Thanks
Peter
Telerik team
 answered on 27 May 2013
2 answers
148 views
I'm facing strange self-referencing grid behaviour. Symptoms:
1) All rows (even without children) contains "+"
2) Expanding parent row cause freeze without any exception thrown.

Object:
public class MyObject
{
    public long Id {get; set;}
    public string Name {get; set;}
    public string Code {get; set;}
    public MyObject Parent {get;set;}
}

Grid contains columns for Code and Name defined in designer.
Than I'm adding self reference:
GridViewTextBoxColumn col1 = new GridViewTextBoxColumn("Id", "Id");
GridViewTextBoxColumn col2 = new GridViewTextBoxColumn("ParentId", "Parent.Id");
grid.MasterTemplate.Columns.Add(col1);
grid.MasterTemplate.Columns.Add(col2);
  
grid.Columns["Id"].IsVisible = false;
grid.Columns["ParentId"].IsVisible = false;
grid.Relations.AddSelfReference(grid.MasterTemplate, "Id", "ParentId");

And data populating:
private void Populate(IList<MyObject> dataToPopulate)
 {
    this.grid.BeginUpdate();
    var relationsBackup = this.grid.Relations.ToList();
    this.grid.Relations.Clear();
    this.grid.DataSource = dataToPopulate;
    this.grid.Relations.AddRange(relationsBackup);
    this.grid.EndUpdate();
    this.grid.MasterView.Refresh();          
 }



Thank for any suggestion in advance.
Peter
Telerik team
 answered on 27 May 2013
8 answers
243 views
I'm copying again.  I think this is a TreeView.  The attached image has my questions.
Peter
Telerik team
 answered on 24 May 2013
2 answers
166 views
Hi,

I'm trying to add a phone number column using the MaskedEditColumn and store it in a nullable double property of a business object, without the mask. However, the code is crashing the I'm leaving the cell with an exception about DataConversion. I found that the value that the grid is trying to set in the PhoneDouble property contains the mask, so the conversion fails. How can I make it work? I thought the MaskFormat = MaskFormat.ExcludePromptAndLiterals would fix that but it doesn't.


I'm using v.2013.1.220.40

Thanks!

--
Frank



public static class GridUtils
{
    public static GridViewMaskBoxColumn AddPhoneNumberColumn(this RadGridView grid, string uniqueName, string fieldName, string headerText, Type type)
    {
        GridViewMaskBoxColumn col = new GridViewMaskBoxColumn();
        col.Name = uniqueName;
        col.FieldName = fieldName;
        col.HeaderText = headerText;
        col.MaskType = MaskType.Standard;
        col.Mask = "(000) 000-0000";
        col.FormatString = "{0:(###) ###-####}";
        col.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
        col.DataType = type;
 
        grid.Columns.Add(col);
 
        return col;
    }
}
 
public class Form2 : Form
{
    private BindingList<TestClass> _dataSource;
 
    public class TestClass
    {
        private string _string;
        private double? _double;
        public string PhoneString
        {
            get { return this._string; }
            set { this._string = value; }
        }
 
        public double? PhoneDouble
        {
            get { return this._double; }
            set { this._double = value; }
        }
    }
 
    public Form2()
    {
        InitializeComponent();
 
        this.radGridView1.AutoGenerateColumns = false;
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        this.radGridView1.AddPhoneNumberColumn("stringMasked", "PhoneString", "PhoneStringMasked", typeof(string));
        this.radGridView1.AddPhoneNumberColumn("doubleMasked", "PhoneDouble", "PhoneDoubleMasked", typeof(double?));
 
        this._dataSource = new BindingList<TestClass>();
        this._dataSource.Add(new TestClass() { PhoneDouble = 5554443333, PhoneString = "5554443333" });
 
        this.radGridView1.DataSource = this._dataSource;
    }
 
    #region Designer
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
 
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }
 
    #region Windows Form Designer generated code
 
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        this.radGridView1 = new Telerik.WinControls.UI.RadGridView();
        ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).BeginInit();
        this.SuspendLayout();
        //
        // radGridView1
        //
        this.radGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.radGridView1.Location = new System.Drawing.Point(0, 0);
        this.radGridView1.Name = "radGridView1";
        this.radGridView1.Size = new System.Drawing.Size(607, 284);
        this.radGridView1.TabIndex = 0;
        this.radGridView1.Text = "radGridView1";
        //
        // Form2
        //
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(607, 284);
        this.Controls.Add(this.radGridView1);
        this.Name = "Form2";
        this.Text = "Form2";
        ((System.ComponentModel.ISupportInitialize)(this.radGridView1)).EndInit();
        this.ResumeLayout(false);
 
    }
 
    private Telerik.WinControls.UI.RadGridView radGridView1;
    #endregion
    #endregion
 
}
Peter
Telerik team
 answered on 24 May 2013
4 answers
205 views
I have a problem I have a grid that has a commandcolumn in it. When the user tries to print the grid it also prints the commandcolumn which it shouldn't do. So i though i had found a work around for it by making the column not visible when passed the grid to the radprintdoucment. The problem is though when i re-size the margins on the print document it is bringing back the command column. I was wondering if anyone had any idea of how i would go about fixing this. My thought was to do the following, but when i do that if i delete one grids cart column it deletes both of them. How can I delete the cart column in just the TGrid?  

Dim tGrid As New RadGridView
tGrid = grdItem
tGrid.Columns.Remove("cart")
PrintReport(tGrid, rptname & " Report")

Ivan Petrov
Telerik team
 answered on 23 May 2013
1 answer
291 views
Hi, I have a project requirement where header of telerik gridview will be a checkbox and columns below this header should be radiobutton.
I need urgent help to resolve this issue. I had attached pic where i last three colum that is Merge,Overwrite and Ignore should have checkbox colum and data under these column should be radio button. Grouping of these radio button will be per row. User can select multiple rows and pressing checkbox will check/uncheck those rows radiobuttons. My real problem is column header checkbox and datacolumn as radio box. 
Paul
Telerik team
 answered on 23 May 2013
0 answers
120 views
Hi,

I'm wondering whether there are any other developers using Telerik tools who also use CodeFluent Entities and VB.NET. I'm building an application using Visual Studio 2012 Professional, SQL Server 2008 R2 and Telerik Win Forms toolkit (latest release Q1 2013), .NET Framework 4.5 and CodeFluent Entities. If you have to ask what CodeFluent Entities is then you're not using it but it's a model-driven code and database generation toolkit that integrates into Visual Studio as an add-in in exactly the same way that Telerik does.

Without in any way being critical of the support provided by either Telerik or CodeFluent, who have both been very responsive and helpful, I'm struggling to resolve what I think should be a relatively simple problem, that of editing a collection of objects via a RadGridView control. CodeFluent generates objects and collections and the methods to Load and Save the members of those collections.

Telerik quite rightly doesn't test their toolkits against CodeFluent Entities and CodeFluent doesn't test their software against Telerik toolkits. I receive an error in certain circumstances which can't be easily tested by either Telerik or CodeFluent so it's hard to know where to look, so before I post a specific question I wanted to find out whether there are any other users out there developing with this combination of tools or am I doing this on my own?

Any assistance will be greatly appreciated.

Thanks in anticipation

Peter
Peter Stanford
Top achievements
Rank 1
 asked on 23 May 2013
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
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?