Hi,
We want to create an custom RibbonBar on the orderlist view to connect to an external webservice. See our current code below.
The button shows up fine but when clicked the orders stay empty in ribbonBtn_Click
How can get the selected orders on button click?
[AddInTarget(RibbonBarAddInTarget.eCom.OrderList)]
public class OrderListRibbonBar : RibbonBarAddIn
{
public OrderListRibbonBar(RibbonBar ribbon) : base(ribbon) { }
public override void Load()
{
Order[] orders = base.Ribbon.DataContext.DataSource as Order[];
RibbonBarButton ribbonBtn = new RibbonBarButton
{
Text = "Send",
Icon = Dynamicweb.Core.UI.Icons.KnownIcon.ArrowCircleORight,
Size = Icon.Size.Large,
EnableServerClick = true,
};
ribbonBtn.Click += ribbonBtn_Click;
var buttonGroup = Ribbon.CreateGroup("MyButtons", "Actions");
buttonGroup.AddItem(ribbonBtn);
}
void ribbonBtn_Click(object sender, EventArgs e)
{
Order[] orders = base.Ribbon.DataContext.DataSource as Order[];
//TODO: Send selected orders
}
}