Hey, is there a way to change the popup location of RadDropDownButton? I'm currently trying to put it over the button and at the right side. See screenshot to know what I mean. It's is not showing correctly because the edge of the screen.
I've tried setting the popup bound but it don't work
btnOpcoesTela.DropDownButtonElement.DropDownMenu.PopupOpened += DropDownMenu_PopupOpened;
private
void
DropDownMenu_PopupOpened(
object
sender, EventArgs args)
{
var popup = sender
as
RadDropDownButtonPopup;
popup.SetBounds(10, 5, popup.Width, popup.Height);
}
I want to create a RadGridViewwhich allow the user to enter the multiple materials just click on add material
as well as after list of material adds, we can add the multiple labours also
I have this code modified from example for moving rows between grids:
GridDataRowBehavior:
public
class
RowSelectionGridBehavior : GridDataRowBehavior
{
private
List<GridViewRowInfo> selectedRows =
new
List<GridViewRowInfo>();
protected
override
bool
OnMouseDownLeft(MouseEventArgs e)
{
GridDataRowElement row =
this
.GetRowAtPoint(e.Location)
as
GridDataRowElement;
if
(row !=
null
)
{
RadGridViewDragDropService svc =
this
.GridViewElement.GetService<RadGridViewDragDropService>();
svc.AllowAutoScrollColumnsWhileDragging =
true
;
svc.AllowAutoScrollRowsWhileDragging =
true
;
svc.Start(row);
}
return
base
.OnMouseDownLeft(e);
}
}
My extension of RadGridView
public
delegate
void
MovingItemsEvent(List<GridViewRowInfo> rows,
object
source,
object
target);
public
event
MovingItemsEvent MovingItems;
//THIS IS THE PART I DON'T LIKE
private
void
ExtendedGrid_MouseDown(
object
sender, MouseEventArgs e)
{
if
(e.Button == System.Windows.Forms.MouseButtons.Left && EnableDragnDrop)
{
GridGroupContentCellElement row =
this
.ElementTree.GetElementAtPoint(e.Location)
as
GridGroupContentCellElement;
if
(row !=
null
)
{
RadGridViewDragDropService svc =
this
.GridViewElement.GetService<RadGridViewDragDropService>();
svc.AllowAutoScrollColumnsWhileDragging =
true
;
svc.AllowAutoScrollRowsWhileDragging =
true
;
svc.Start(row);
}
}
}
private
bool
_EnableDragnDrop;
[BrowsableAttribute(
true
)]
public
bool
EnableDragnDrop
{
get
{
return
this
._EnableDragnDrop; }
set
{
_EnableDragnDrop = value;
if
(value)
{
//register the custom row selection behavior
var gridBehavior =
this
.GridBehavior
as
BaseGridBehavior;
gridBehavior.UnregisterBehavior(
typeof
(GridViewDataRowInfo));
//gridBehavior.UnlockBehavior(typeof(GridGroupContentCellElement));
gridBehavior.RegisterBehavior(
typeof
(GridViewDataRowInfo),
new
RowSelectionGridBehavior());
}
}
}
private
void
svc_PreviewDragStart(
object
sender, PreviewDragStartEventArgs e)
{
if
(EnableDragnDrop)
e.CanStart =
true
;
}
private
void
svc_PreviewDragOver(
object
sender, RadDragOverEventArgs e)
{
if
(EnableDragnDrop)
e.CanDrop =
true
;
}
private
void
svc_PreviewDragDrop(
object
sender, RadDropEventArgs e)
{
if
(EnableDragnDrop)
{
var dropTarget = e.HitTarget
as
RadItem;
var targetGrid = dropTarget.ElementTree.Control
as
RadGridView;
//append dragged rows to the end of the target grid
List<GridViewRowInfo> rows =
new
List<GridViewRowInfo>();
if
(e.DragInstance
is
GridGroupContentCellElement)
{
e.Handled =
true
;
GridGroupContentCellElement group = e.DragInstance
as
GridGroupContentCellElement;
foreach
(var row
in
group.ViewInfo.CurrentRow.ChildRows)
{
rows.Add(row);
}
this
.MoveRows(targetGrid, rows);
}
else
if
(e.DragInstance
is
GridDataRowElement)
{
e.Handled =
true
;
foreach
(var row
in
this
.SelectedRows)
{
rows.Add(row);
}
this
.MoveRows(targetGrid, rows);
}
}
}
private
void
MoveRows(RadGridView targetGrid, List<GridViewRowInfo> dragRows)
{
this
.BeginUpdate();
targetGrid.BeginUpdate();
if
(MovingItems !=
null
)
{
MovingItems(dragRows,
this
, targetGrid);
}
this
.EndUpdate(
true
);
targetGrid.EndUpdate(
true
);
}
This works fine without any problem, but I would like if ther is a better way to allow Grouped rows to be dragged, like for example registering a GridBehavior like in the case of ordinary rows
Hello,
I have defined my own GroupBox, that inherits the RadGroupBox.
If I apply a Theme, nothing happend.
Button, MaskedEditBox, CheckBox etc. works fine, but not the GroupBox.
Is this an known issue?
Regards
First, I'm new to Telerik Controls.
I'm trying to show a simple hierarchical class (some Properties and a List<T> with sub entries) in a RadGridView. I figured out I can use "AutoGenerateHierarchy" which works so far. But I'm having a real hard time to make it look how I need it. Especially for the sub entries. What ever I change in the Property Builder on "Template1" doesn't seem to have any effect. Also does it display a + even if the entry doesn't have sub entries.
I would appreciated if you could help me out with this...
Greetings,
I want the RadTimePicker to show only Time value , not date. How to do that ?
Thanks