Telerik Forums
UI for WinForms Forum
2 answers
294 views
Hello!

Is it possible not to close dropdownlist panel when I select some items?
For example, I have smth like treeview (not true treeview, but imagine):
Master Item:
  item1
  item2
  item3 
and so on.

For now I use the following code:
if (e.Position == 1)//Master item position == 1.
{
  e.Cancel = true;
  return;
}
...

Selected text(index) doesn't change, but it would be more convinient
and elegant if dropdownlist panel won't close  if I select "Master Item:".
Is it possible?

Thanks in advance.
Stefan
Telerik team
 answered on 05 Sep 2011
4 answers
131 views
Hi,

Is it possible to do any HTML like formatting in a group header row?  I'm currently changing the header in GroupSummaryEvaluate event right now.

Thanks!



Christ
Top achievements
Rank 2
 answered on 05 Sep 2011
4 answers
232 views
Is there an easy way to determine if the open document has any changes?

I want to prompt the user to see if they want to save the document when they try to close the document or open a new one, but only if the document has changed.

Thanks.
Jeff Clark
Top achievements
Rank 1
 answered on 02 Sep 2011
4 answers
252 views
I have a small question. I'm trying to display the user email addressin a datagrid for winform and i have tried everything to  make it look like a link and it doesnt work.  All I want is the user to be able to click the email address to be able to sendan email to the selected address.  
Can anyone help me out here by letting meknow whats the format to use?    Remember I'm looking for the Radgridview for Winforms not the ASP.net one..


Thanks in advance


Jose 
Jose R
Top achievements
Rank 1
 answered on 02 Sep 2011
10 answers
273 views
Hi,

With Q2 2011 DateTimePicker if I set the NullDate to DateTime.Today.AddSeconds(1) I can not set the date to today's date as it shows up blank (null) as soon as I choose todays date. If I choose the day before or after today it works.  Did something break in this version or am I missing something?  Also, it would be nice if by default if the user hits the delete key anywhere within the date text that the value is set to null and the textbox is cleared.  It is a problem to our users when the delete button is hit in the year field and it just changes to 0001 as in your examples.

I followed this thread to set nulldate to today to avoid having the calendar show or 0001 for the year. http://www.telerik.com/community/forums/winforms/calendar-and-datetimepicker/setting-mindate-but-not-value.aspx

Thanks!
Peter
Telerik team
 answered on 02 Sep 2011
3 answers
234 views
Hi there,

I'm currently evaluating the Telerik RadControls for WinForms and I'm trying to accomplish something with the DataGrid component. I am wondering if there is any way to specify different child templates for the top level rows in the grid.

I have a dataset that consists of a List<ICommonData>. I have 2 classes (say ClassA and ClassB) that implement ICommonData. My datasource contains a list of both ClassA and ClassB objects. The parent rows of the grid show all the properties declared in ICommonData. What I want is when the user expands the parent row, I want them to see a sub grid that shows other ClassA or ClassB columns depending on what data object that row was bound to. Basically I need the ability to specify dynamically which template each row uses when displaying the child grid.

Is there any way to do this?

Thanks,
Josh
Jack
Telerik team
 answered on 02 Sep 2011
6 answers
265 views
Hi,
I have a custom cell editor that contains a TextBox and a Button. The user can edit the text directly or press the button to display a dialog. Using the examples I found I could implement nearly everthing but one thing is missing:
When editing starts I would like to set the focus to the TextBox in theeditor and select the contained text, so that the user can start typing immediately. Just the behaviour of the normal GridViewTextBoxColumn. In my editor an extra click is required to start typing. The call to Focus() seems to have no effect.

Thanks in advance
Christoph

(Using Q2 2011 on .NET 3.5)

This is what I did:

My custom GridViewDataColumn:
public class IntelliBoxColumn : GridViewDataColumn
{
    public IntelliBoxColumn(string columnName) : base(columnName) { }
 
    public override Type GetDefaultEditorType()
    {
        return typeof(IntelliBoxGridEditor);
    }
 
    public override Type GetCellType(GridViewRowInfo row)
    {
        if (row is GridViewDataRowInfo)
        {
            return typeof(IntelliBoxCellElement);
        }
        return base.GetCellType(row);
    }
}

My custom EditorElement:
public partial class IntelliBoxEditorElement : LightVisualElement
{
 
    RadTextBoxItem textBox;
    RadButtonElement button;
 
    public RadTextBoxItem TextBox { get { return this.textBox;}}
 
    public RadButtonElement Button { get { return this.button; } }
 
    protected override void CreateChildElements()
    {
        textBox = new RadTextBoxItem();
        textBox.RouteMessages = true;
        button = new RadButtonElement("...");
        button.Padding = new Padding(2, 0, 2, 0);
        this.Children.Add(textBox);
        this.Children.Add(button);
    }
 
    protected override SizeF ArrangeOverride(SizeF finalSize)
    {
        RectangleF clientRect = GetClientRectangle(finalSize);
        RectangleF buttonRect = new RectangleF(clientRect.Right - button.DesiredSize.Width, clientRect.Top,
            button.DesiredSize.Width, clientRect.Height);
        RectangleF textRect = new RectangleF(clientRect.Left, clientRect.Top + (clientRect.Height - textBox.DesiredSize.Height) / 2,
            buttonRect.Left - clientRect.Left - 2, textBox.DesiredSize.Height);
 
        foreach (RadElement element in this.Children)
        {
            if (element == this.textBox)
            {
                element.Arrange(textRect);
            }
            else if (element == this.button)
            {
                element.Arrange(buttonRect);
            }
            else
            {
                ArrangeElement(element, finalSize);
            }
        }
        return finalSize;
    }
 
}

My custom GridEditor:
I try to set the focus in BeginEdit() but this has no effect.

public class IntelliBoxGridEditor : BaseGridEditor
{
    private bool endEditOnLostFocus = false;
 
    protected override Telerik.WinControls.RadElement CreateEditorElement()
    {
        return new IntelliBoxEditorElement();
    }
 
    private IntelliBoxEditorElement IntelliBox
    {
        get { return (IntelliBoxEditorElement)EditorElement; }
    }
 
    public override bool EndEditOnLostFocus
    {
        get { return endEditOnLostFocus; }
    }
 
    public override object Value
    {
        get { return IntelliBox.Text;}
        set
        {
            string strValue = string.Empty;
            if (value != null && value != DBNull.Value) strValue = value.ToString();
            IntelliBox.TextBox.Text = strValue;
        }
    }
 
    public override Type DataType
    {
        get { return typeof(string);}
    }
 
    public override void BeginEdit()
    {
        base.BeginEdit();
        IntelliBox.TextBox.TextChanging += new TextChangingEventHandler(TextBox_TextChanging);
        IntelliBox.TextBox.TextChanged += new EventHandler(TextBox_TextChanged);
        IntelliBox.TextBox.KeyDown += new KeyEventHandler(TextBox_KeyDown);
        IntelliBox.Button.Click += new EventHandler(Button_Click);
        IntelliBox.TextBox.SelectAll();
        IntelliBox.TextBox.Focus();
    }
 
    public override bool EndEdit()
    {
        IntelliBox.TextBox.TextChanging -= new TextChangingEventHandler(TextBox_TextChanging);
        IntelliBox.TextBox.TextChanged -= new EventHandler(TextBox_TextChanged);
        IntelliBox.TextBox.KeyDown -= new KeyEventHandler(TextBox_KeyDown);
        IntelliBox.Button.Click -= new EventHandler(Button_Click);
        return base.EndEdit();
    }
 
    void TextBox_TextChanging(object sender, TextChangingEventArgs e)
    {
        ValueChangingEventArgs args = new ValueChangingEventArgs(e.NewValue);
        args.OldValue = e.OldValue;
        OnValueChanging(args);
        e.Cancel = args.Cancel;
    }
 
    void TextBox_TextChanged(object sender, EventArgs e)
    {
        OnValueChanged();
    }
 
    void TextBox_KeyDown(object sender, KeyEventArgs e)
    {
        RadGridView grid = ((RadElement)sender).ElementTree.Control as RadGridView;
        if (grid != null)
        {
            switch (e.KeyCode)
            {
                case Keys.Escape:
                case Keys.Enter:
                case Keys.Up:
                case Keys.Down:
                    grid.GridBehavior.ProcessKeyDown(e);
                    break;
            }
        }
    }
 
    void Button_Click(object sender, EventArgs e)
    {
        endEditOnLostFocus = false;
        var gridView = (WPDataGrid)IntelliBox.ElementTree.Control;
        gridView.RaiseButtonClicked(this);
        endEditOnLostFocus = true;
        gridView.EndEdit();
    }
 
}


My custom GridDataCellElement:
(The puspose of this cell-element is to start editing as soon as cell becomes current. I did not manage to get this behaviour by setting BeginEditMode)
public class IntelliBoxCellElement : GridDataCellElement
{
    private RadLabelElement _label;
 
    private IntelliBoxColumn _column;
    private GridRowElement _row;
 
    public IntelliBoxCellElement(GridViewColumn column, GridRowElement row)
        : base(column, row)
    {
        this.BackColor = Color.White;
    }
 
    private bool _wasCurrent;
 
    public override bool IsCurrent
    {
        get return base.IsCurrent; }
        set
        {
            base.IsCurrent = value;
            if (value && value != _wasCurrent)
                _row.RowInfo.Cells[_column.Name].BeginEdit();
 
            _wasCurrent = value;
        }
    }
 
    protected override Type ThemeEffectiveType { get {return typeof(GridDataCellElement); } }
 
    public override void Initialize(GridViewColumn column, GridRowElement row)
    {
        _column = (IntelliBoxColumn)column;
        _row = row;
        base.Initialize(column, row);
    }
 
    protected override void CreateChildElements()
    {
        _label = new RadLabelElement();
        _label.Margin = new Padding(2, 2, 2, 2);
        _label.LabelText.AutoEllipsis = true;
        _label.LabelText.AutoSize = true;
        _label.LabelText.AutoSizeMode = RadAutoSizeMode.Auto;
        _label.LabelText.TextWrap = false;
        this.Children.Add(_label);
    }
 
    protected override void DisposeManagedResources()
    {
        base.DisposeManagedResources();
    }
 
    protected override void SetContentCore(object value)
    {
        if (value != null)
        {
            _label.Text = value.ToString();
        }
    }
 
    public override bool IsCompatible(GridViewColumn data, object context)
    {
        return data is IntelliBoxColumn && context is GridDataRowElement;
    }
}


Stefan
Telerik team
 answered on 02 Sep 2011
1 answer
108 views
When I view entries in my RadGridView that users have submitted that contain a text background color (in HTML) I get these weird spots of 1px whitespace in-between words. Please look at my attachment for reference. I was wondering if there is anyway to fix this?
Peter
Telerik team
 answered on 02 Sep 2011
2 answers
196 views
Hello,

how can I get a Right-Click from a RadPageViewPage? The MouseClick-Event only fires, when the User clicks on the Content-Area, not the "Header". And the Mouse-Click-Event from the RadPageView will be fired, but I don't get the clicked Page there.

I'm using the ExplorerBar-Mode.

Thank you!
Andy
n/a
Top achievements
Rank 1
 answered on 02 Sep 2011
3 answers
210 views
hi, i have a multicolumncombox object on my form, i only display the first column.
The cell width is larger than the multicolumncombox, so when i select an item, it's right aligned in the multicolumncombobox object like the screenshot.

Optionnaly i don't want the control to be highlighted when i change selected item.


thanks
OD
Top achievements
Rank 1
 answered on 02 Sep 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
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
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?