Telerik Forums
UI for WinForms Forum
1 answer
152 views
I am pretty new to RadCalendar.
How can I bind RadCalendar to a local database?
The aim is for the RadCalendar to show the Database inputs.


Any Help will be appreciated 

Regards
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Feb 2015
1 answer
208 views
I am overriding my GetProperties() and Sort Methods of an objects PropertyDescriptorCollection in order to sort by index of a collection.

In the ms winforms propertyGrid this is displaying as expected, while in the Telerik radPropertyGrid it is not performing the same as the picture depicts.

Is there a reason this isn't compatible with the Telerik PropertyGrid?

Below is the code for the PropertyDescriptorCollection sort and GetProperties overrides:

class UserDataPropertyDescriptorCollection : PropertyDescriptorCollection
{
    public UserDataPropertyDescriptorCollection(PropertyDescriptor[] propertyDescriptors)
        : base(propertyDescriptors)
    {
    }
 
    public override PropertyDescriptorCollection Sort()
    {
        PropertyDescriptorCollection ret = new PropertyDescriptorCollection(null);
        return this;
    }
 
    public override PropertyDescriptorCollection Sort(string[] names)
    {
        return this;
    }
 
    public override PropertyDescriptorCollection Sort(string[] names, System.Collections.IComparer comparer)
    {
        return this;
    }
 
    public override PropertyDescriptorCollection Sort(System.Collections.IComparer comparer)
    {
        return this;
    }
 
}
 
public class UserDataExpandableObjectConverter : ExpandableObjectConverter
{
    public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
    {
        PropertyDescriptorCollection d = base.GetProperties(context, value, attributes);
        List<PropertyDescriptor> props = new List<PropertyDescriptor>();
 
        foreach (PropertyDescriptor f in d)
        {
            props.Add(f);
        }
 
        UserDataPropertyDescriptorCollection m = new UserDataPropertyDescriptorCollection(props.ToArray());
        return m;
    }
}

The object being displayed in the propertyGrid
public class alpha
{
    private UserDataCollection usd;
    private string test;
 
    public alpha()
    {
        usd = new UserDataCollection();
        test = "Fun";
    }
 
    [TypeConverterAttribute(typeof(UserDataExpandableObjectConverter))]
    [Category("Collection")]
    public UserDataCollection Collection
    {
        get { return usd; }
        set { usd = value; }
    }
 
    [Category("String")]
    public string Attr
    {
        get { return test; }
        set { test = value; }
    }
}

The form:

public Form1()
{
    InitializeComponent();
    UserDataCollection temp = new UserDataCollection();
    alpha obj = new alpha();
    //Inner test = new Inner();
 
    for (int i = 0; i < 25; i++)
    {
        obj.Collection.Add("");
    }
    radPropertyGrid1.SelectedObject = obj;
}

The only difference between the two projects is the propertyGrid
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Feb 2015
1 answer
139 views
I am creating a new ItemElementType of CustomItem in the CreateItemElement of the property Grid. I override the CreatePropertyGridValueElement but then i notice that Data pointer is set to null, even though the  Item is already create in the createItemElement of the property grid. So my question is that how do i get access to the PropertyGridItemBase object in the CreatePropertyGridValueElement since the only way to create the object it seems like you have to set the e.ItemElementType to a specific type you want to create using reflection.

Thanks.
Dimitar
Telerik team
 answered on 06 Feb 2015
3 answers
148 views
Hello everybody,

at first, the controls involved in the problem are the following:
- RadTextBox
- RadSpellchecker (spell check as you type mode)
- ContextMenuStrip 

I want to use a RadTextBox within a customized ContextMenuStrip and a RadSpellchecker. The problem is, that the RadSpellchecker overwrites the customized ContextMenuStrip with its own ContextMenuStrip if there are wrong words.
Have you an idea how to use the customized ContextMenuStrip and the RadSpellchecker ContextMenuStrip at the same time?

Many thanks in advance for your help
Dennis
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 Feb 2015
2 answers
428 views
I would like to override the TextChanged event of my own inherited textbox.  How should I proceed?
For the Click event of an inherited button I do have the following working code, but for a textbox I cannot find the right way.

using System;
using System.Windows.Forms;
using Telerik.WinControls.UI;

namespace Iap.WinUi.Controls.Button
{
public class QButton : RadButton
{
protected override RadButtonElement CreateButtonElement()
{
return new QButtonElement(this);
}
}

public class QButtonElement : RadButtonElement
{
private readonly RadButton Owner;

public QButtonElement(RadButton owner)
{
Owner = owner;
}

protected override void OnClick(EventArgs e)
{
var form = Owner.FindForm();
try
{
// set wait cursor
form.Cursor = Cursors.WaitCursor;
form.Refresh();

// execute base click code
base.OnClick(e);
}
finally
{
// set arrow cursor
form.Cursor = Cursors.Default;
}
}

protected override Type ThemeEffectiveType
{
get { return typeof (RadButtonElement); }
}
}
}
hans
Top achievements
Rank 1
 answered on 06 Feb 2015
3 answers
126 views
Have upgraded a small application to VS2013. It is using Telerik (2010.1.519.20) and it looks good except in two RadGrid objects. The failing grids is showing the information in an unformated way. Do see any error messages anywhere. Any idees on how to continue? Beginner to Telerik.
Dimitar
Telerik team
 answered on 05 Feb 2015
3 answers
209 views
I have notice that when i hide a document window and show it, it is showing back up in the main tab window. How can i get it to show up exactly where i had it close. The issue is that i have 4 document windows and i want my documents window to show back up exactly where they were before i hide them. I do notice that this seems to work with Tool windows, but i would like to know if it is possible with document windows.

Thanks,
Jerome.
Hristo
Telerik team
 answered on 05 Feb 2015
6 answers
98 views
when using PropertyGridSpinEditor up and down arrow to change a value, then clicking on the box value. It cause a crash.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Feb 2015
1 answer
737 views
How can I save my documents to database sql server and open it.

I am using the control RichTextEditorRibbonBar

I want armagenar all information in the database and access starting from the database as well.

I want save all information (Doc,Richt,PDF) in the database and access starting from the database as well.

and export to my computer when necessary

I can not edit the elements "RibbonBar" to Portuguese
I can not also see the code to change to my taste


automatically configures  and not the possibility of choice

 Try--------------------------------------------SAVE-------------------------------------------------
            rtbDoc.SaveFile("temp.rtf")
            stream = New FileStream("temp.rtf", FileMode.Open, FileAccess.Read)
            Dim size As Integer = Convert.ToInt32(stream.Length)
            Dim rtf As [Byte]() = New [Byte](size - 1) {}
            stream.Read(rtf, 0, size)

            Dim paramRTF As New SqlParameter("@Documento", SqlDbType.VarBinary, rtf.Length, ParameterDirection.Input, False, 0, 0, Nothing, DataRowVersion.Current, rtf)
            '    cmd.Parameters.Add(paramRTF)
            Using connection As New SqlClient.SqlConnection(Ligarservidor)
                connection.Close()
                Dim SQL As String = "INSERT INTO doc (ID,Processo,data,tipo,Documento) VALUES (@ID,@Processo,@data,@Tipo,@Documento);"
                Dim command As New SqlCommand(SQL, connection)
                command.Parameters.AddWithValue("@ID", SqlDbType.NVarChar).Value = "1"
                command.Parameters.AddWithValue("@Processo", SqlDbType.NVarChar).Value = "W"
                command.Parameters.AddWithValue("@Data", SqlDbType.NVarChar).Value = "W"
                command.Parameters.AddWithValue("@Tipo", SqlDbType.NVarChar).Value = "W"
                command.Parameters.Add(paramRTF)
                connection.Open()
                command.ExecuteNonQuery()
                MessageBox.Show("Informação registada!...", "Info")
            End Using
        Catch ex As Exception
        Finally
            If stream IsNot Nothing Then
                stream.Close()
            End If

        End Try




-------------------------------------------------------------READ------------------------------------------------------------------
  Dim cn As SqlConnection = Nothing
        Dim cmd As SqlCommand = Nothing
        Dim reader As SqlDataReader = Nothing
        Try
            cn = New SqlConnection(Ligarservidor)
            cn.Open()
            cmd = New SqlCommand("SELECT documento FROM doc WHERE ID=1", cn)
            reader = cmd.ExecuteReader()
            reader.Read()
            If reader.HasRows Then
                If Not reader.IsDBNull(0) Then
                    Dim rtf As [Byte]() = New [Byte](Convert.ToInt32((reader.GetBytes(0, 0, Nothing, 0, Int32.MaxValue))) - 1) {}
                    Dim bytesReceived As Long = reader.GetBytes(0, 0, rtf, 0, rtf.Length)

                    Dim encoding As New ASCIIEncoding()
                    rtbDoc.Rtf = encoding.GetString(rtf, 0, Convert.ToInt32(bytesReceived))
                End If
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            If reader IsNot Nothing Then
                reader.Close()
            End If
            If cn IsNot Nothing Then
                cn.Close()
            End If
        End Try


Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Feb 2015
1 answer
240 views
I create a custom node with a RadFormElement for each node added to the tree view. The issue i am running into is that the node size squishes my window and i cannot see the whole window. Is there any way i can view the entire window for each node. I change the AllowArbitrary item height and it makes no difference.
This is very urgent, the sooner this can be answered, the better. I am on a deadline.

Thanks,
jerome
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 04 Feb 2015
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
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?