How set margin for Image in RadContextMenu (RadMenuItem)?
Now when setting the image to RadMenuItem, it is too close to the text and left border. How to regulate it?
RadTabbedFormControl.ContextMenuOpening += (obj, arg) => {
arg.ContextMenu.Items.Clear();
};
e.Tab.Item.MouseDown += (obj, args) => {
if
(args.Button == MouseButtons.Right)
{
ContextMenu testMenu=
new
ContextMenu();
testMenu.MenuItems.Add(
"Test"
);
testMenu.Show(e.Tab,
new
Point(args.Location.X + 5, args.Location.Y - 35));
}
};
But there was a problem with the error (Unable to display ContextMenu in invisible control) when clicking on an inactive tab.
Can you tell me another way?
Hi, I'm using below code to validate items in the data entry. This event triggers whenever the items lose focus.
dataEntry.ItemValidated += (s, e) =>
{
ContactEntries employee = dataEntry.CurrentObject
as
ContactEntries;
if
(e.Label.Text ==
"Contact person:"
)
{
if
(employee.contactPerson.Length < 10)
{
Console.WriteLine(
"validated"
);
e.ErrorProvider.SetError(s
as
Control,
"Field is required"
);
if
(!dataEntry.ValidationPanel.PanelContainer.Controls.ContainsKey(
"Contact person:"
))
{
RadLabel label =
new
RadLabel();
label.Name =
"contactPerson"
;
label.Text =
"<html><size=10><b><color= Red>Contact person: </b><color= Black>First Name should be between 2 and 15 chars long."
;
label.Dock = DockStyle.Top;
label.AutoSize =
false
;
label.BackColor = Color.Transparent;
dataEntry.ValidationPanel.PanelContainer.Controls.Add(label);
}
}
else
{
e.ErrorProvider.Clear();
dataEntry.ValidationPanel.PanelContainer.Controls.RemoveByKey(
"contactPerson"
);
}
}
};
On the first page of the data entry, the items contains predefined values, but the data entry is also connection with a binding navigator, allowing users to add a new page. How can I validate these two pages in case the user does not click each item that will trigger the validation?
Is there some way I can trigger the ItemValidated event manually?
Thanks in advance!
How do I get the RadTabbedFormControlTab in the ContextMenuOpening on which the context menu was called?
RadTabbedFormControl.ContextMenuOpening += (obj, arg) => {
arg.TabItem
// There is only a TabItem, which is not a RadTabbedFormControlTab :(
};
I would like to get the tab on which the menu was called
Greetings,
I am interested in knowing why code 1 works but code 2 below does not in repositioning the scroll on a RadGridView. Also, any posibile solution as to why code 2 does not work would be appreciated. Thank you.
Works:
Code 1 : dvTrackingLog.TableElement.ScrollTo(30, 0);
Code 1a: dvTrackingLog.CurrentRow = dvTrackingLog.Rows[30];
AutoScrollGrid(30);
Code 1b: dvTrackingLog.TableElement.ScrollTo(rowIndex, 0);
Code 1c: dvTrackingLog.CurrentRow = dvTrackingLog.Rows[rowIndex];
Does not work:
Code 2: dvTrackingLog.TableElement.ScrollTo(dvTrackingLog.SelectedRows[0].Index, 0);
Code 2a: dvTrackingLog.CurrentRow = dvTrackingLog.Rows[dvTrackingLog.SelectedRows[0].Index];
AutoScrollGrid(rowIndex);
Code 2b: dvTrackingLog.TableElement.ScrollTo(rowIndex, 0);
Code 2c: dvTrackingLog.CurrentRow = dvTrackingLog.Rows[rowIndex];
I can move and show trackball programmatically from this thread https://www.telerik.com/forums/programatically-move-and-show-trackball.
And how to hide trackball programmatically?