Hi,
I want the user to be able to insert a new item in the combobox (via the underlying TextBoxEditor).
When entered, the user should see the newly added item as selected in the combobox.
I'm probably missing an event or not making the add/set DataSource at the good place.
I'm doing everything in the CellEndEdit event handler of the grid.
Reproduce: double-click on "Type 1", type any text and change the column.
If you re-open the content of the combo, the new item is there
public
partial
class
RadForm1 : Telerik.WinControls.UI.RadForm
{
private
List<KeyValuePair<
string
,
string
>> _list;
public
RadForm1()
{
InitializeComponent();
this
.Load += RadForm1_Load;
radGridView1.CellEndEdit += RadGridView1_CellEndEdit;
}
private
void
RadForm1_Load(
object
sender, EventArgs e)
{
_list =
new
List<KeyValuePair<
string
,
string
>>();
_list.Add(
new
KeyValuePair<
string
,
string
>(TestType.type_1.ToString(),
"Type 1"
));
_list.Add(
new
KeyValuePair<
string
,
string
>(TestType.type_2.ToString(),
"Type 2"
));
_list.Add(
new
KeyValuePair<
string
,
string
>(TestType.type_3.ToString(),
"Type 3"
));
SetColumnDataset();
LoadData();
}
private
void
SetColumnDataset()
{
var comboColumn = radGridView1.Columns[
"columnCombo"
]
as
Telerik.WinControls.UI.GridViewComboBoxColumn;
if
(comboColumn !=
null
)
{
comboColumn.DropDownStyle = RadDropDownStyle.DropDown;
comboColumn.DataSource = _list;
comboColumn.DisplayMember =
"Value"
;
// name to show
comboColumn.ValueMember =
"Key"
;
// name of element of Guid of specific service
}
}
private
void
LoadData()
{
radGridView1.Rows.Clear();
GridViewDataRowInfo rowInfo =
new
GridViewDataRowInfo(
this
.radGridView1.MasterView);
rowInfo.Cells[
"columnCombo"
].Value = Guid.NewGuid().ToString();
rowInfo.Cells[
"columnCombo"
].Value = TestType.type_3.ToString();
radGridView1.Rows.Add(rowInfo);
rowInfo =
new
GridViewDataRowInfo(
this
.radGridView1.MasterView);
rowInfo.Cells[
"columnCombo"
].Value = Guid.NewGuid().ToString();
rowInfo.Cells[
"columnCombo"
].Value = TestType.type_1.ToString();
radGridView1.Rows.Add(rowInfo);
}
void
RadGridView1_CellEndEdit(
object
sender, GridViewCellEventArgs e)
{
// e.ActiveEditor.GetType()
if
(e.Column == radGridView1.Columns[
"columnCombo"
])
{
if
(e.Value !=
null
&& e.Value.ToString() != String.Empty)
{
TestType enumVal;
bool
isEnum = Enum.TryParse<TestType>(e.Value.ToString(),
out
enumVal);
if
(isEnum)
{
// enumVal holds the value
}
else
{
AddNewColumnItem(Guid.NewGuid().ToString());
}
}
else
{
AddNewColumnItem(Guid.NewGuid().ToString());
}
}
}
private
void
AddNewColumnItem(
string
name)
{
if
(!_list.Any(x => x.Key == name))
{
_list.Add(
new
KeyValuePair<
string
,
string
>(name,
string
.Format(
"Type {0}"
, name)));
SetColumnDataset();
}
}
}
public
enum
TestType
{
type_1,
type_2,
type_3
}
I add RadCollapsiblePanel programmaticly to a form (Dock Top).
Is it possible to change the order of the CollapsiblePanel via Drag&Drop?
An alternative could be 2 Buttons (Up/Down) but D&D will be the best solution.
//This doesn't work
MultiColumnComboBox.SelectedValue = 1;
//This is the correct way of seeting the value
MultiColumnComboBox.SelectedValue =
"1"
;
//Another way
MultiColumnComboBox.SelectedValue = Convert.ToInt32(intValue).ToString();
Hi there,
I'm using the RadRichTextEditor the first time and I'm wondering if it is somehow possible to get only the HTML out of the editor. I've thought about something like:
1.
string
htmlText = txtText.Text;
// while txtText is my RadRichTextEditor
1.
HtmlFormatProvider prov =
new
HtmlFormatProvider();
2.
string
htmlText = prov.Export(txtText.Document);
1.
string
htmlText =
"This is a <b>bold</b> text. Great, isn't it?"
I have a simple test Form with just the RadWebCam control on it. When you first open the form, the camera runs at about 10-15fps. Once you take a snapshot it seems to move up fps.(v4.0.30319 - Win10, I7vPro, 16Ram)
Why does it shut the camera off every time you take a snapshot? How can I use it to capture multiple images one after another if it shuts the camera off and displays the image in the viewer after every snapshot?
Hello,
I have a RadDiagram in a winform that displays an image (RadDiagramShape) with a box (RadDiagramShape) over it. A third RadDiagramShape is used to display the region of the first image that the box is over. Mouse events to control dragging and mouse scroll to make the box larger/smaller so that the user can move around the image and zoom in/out. Similarly, the third shape has events for dragging and mouse scroll which controls the box as well.
I am trying to enable similar functionality with touch gestures, but am having some difficulties. I can only seem to enable gestures for the diagram itself, but not for the RadDiagramShapes within it. When I allow zoom gestures on the RadDiagram, it zooms the RadDiagram even though IsZoomEnabled = false. This seems to prevent the zoom for the mouse controls, but not for the gestures. It also moves the diagram around in some cases, although I can't seem to figure out what is moving as the position isn't changing. Pan and Drag are not enabled.
I do not want to zoom into or move the RadDiagram. I want to catch the gesture, and control the size of the box so that the user can zoom in/out as they do with the mouse controls.
In order to do this, I would have to cancel the event and manually process, but I can't seem to figure out a way to do this.
Any ideas?
Thanks
Would be cool if tooltips within the winforms suite would support the same html like formatting as radLabel.
Regards
Erwin