Telerik Forums
UI for WinForms Forum
9 answers
204 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
126 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
100 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
195 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
111 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
141 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
262 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
81 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
3 answers
372 views
Hi im using entity framework to bind the datasource of a RadGridView

private void cmbUsers_SelectedValueChanged(object sender, EventArgs e)
       {
           cmbUsers.ValueMember = "Id";
           var resguardos = from e1 in context.tblBienes
                                        where e1.IdResponsable == (long)cmbUsuarios.SelectedValue
                                        select new
                                        {
                                            Id = e1.IdBien,
                                            Descripcion = e1.descripcion,
                                            Estado = e1.estado,
                                            Placa_Anterior = e1.placaAnterior,
                                            Placa_Nueva = e1.placaNueva,
                                            Ubicacion = e1.ubicacion,
                                            Fecha_De_Asignacion = e1.fechaAsignacion,
                                            Etiqueta = e1.etiqueta,
                                            Procuraduria = context.tblProcuradurias.Where(e2 => (e2.IdProcuraduria == (long)cmbProcuradurias.SelectedValue)).Select((e2 => e2.ciudad)).FirstOrDefault()
                                        };
           rgvResguardos.DataSource = resguardos;
       }

rgvResguardos its a DataGridView and the result of the linq to entities its being given as datasource to it. i enabled Ading and enabled Editing on rgvResguardos but when i run my app it displays data but it doesnt allow me to add new rows nor editing or deleteing.

is there any way to enable this options? i know i have to take care of inserting, deleteing and updating info on the database.
Peter
Telerik team
 answered on 22 May 2013
2 answers
77 views
Hi.

I have an object with a property of type char like this:

public class DummyModel
   {
       public string Stringtest { get; set; }
       public char Chartest { get; set; }
   }


When binding a grid to a list of this objects the values in the char property are displayed correctly in a grid column.

But when I export the grid using ExcelML the column in Excel comes up empty.
Doesn't ExcelML support exporting the char datatype?

Stefan
Telerik team
 answered on 22 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)
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
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
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?