This is a migrated thread and some comments may be shown as answers.

BrowseEditor with CTRL+A / CTRL+X

1 Answer 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rostislaw
Top achievements
Rank 1
Rostislaw asked on 09 Jul 2018, 12:00 PM

Hello *,

1. looking for a possibility to make ctrl+a / ctrl+x, etc. for browseeditor control. Is this possible?

2. Is this possible to add an additional button to the browseeditor (next to ... button) - e.g. one for delete the whole content? Or perhaps there is some other elegant way how I can delete the content of the editor field?

3. I display a path string in the editor control and sometimes the path may be very long. Is there some user-friendly way to display the long path in the edit box with the size significantly smaller as the length of the path string? (e.g. display only the last part of the text or cut something in the middle, or...)

Thanks for the support

Rostislaw

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Jul 2018, 09:41 AM
Hello, Rostislaw,   

1. In order to enable Ctrl+A / Ctrl+X, it is necessary to set the ReadOnly property to false
this.radBrowseEditor1.ReadOnly = false;

2. By design, RadBrowseEditor host a text box which can enable a clear button by setting the BrowseElement.ShowClearButton property to true. But I have noticed that the buttons remains invisible. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to use the following code snippet: 

    LightVisualButtonElement btn = new LightVisualButtonElement();
    btn.Text = "X";
    btn.Click += btn_Click;
    btn.StretchHorizontally = false;
      
    this.radBrowseEditor1.BrowseElement.BrowseButton.Parent.Children.Add(btn);
 
private void btn_Click(object sender, EventArgs e)
{
    this.radBrowseEditor1.Value = null;
}

 

3. When you have a very long path set in the browse editor you can navigate the cursor to the end of the text. Thus, the last part of the path will be displayed in the editor:  



private void RadForm1_Load(object sender, EventArgs e)
{
    this.radBrowseEditor1.ValueChanged += radBrowseEditor1_ValueChanged;
    this.radBrowseEditor1.ReadOnly = false;
    this.radBrowseEditor1.Value = @"D:\Projects\1175293 BrowseEditor\Properties\AssemblyInfo.cs";
}
 
private void radBrowseEditor1_ValueChanged(object sender, EventArgs e)
{
    this.radBrowseEditor1.BrowseElement.TextBoxItem.SelectionStart = this.radBrowseEditor1.BrowseElement.Text.Length;
}

I hope this information helps. If you have any additional questions, please let me know.  
 
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Rostislaw
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or