The RadButtonElement is not aligned, because RadListBoxItem is just a holder of the elements, but it does not act as a layout panel.
You can align the buttons to the right of the text by inserting the buttons in the StackLayoutPanel that holds the text. In this case the code snippet that you should use is:
sender, Telerik.WinControls.UI.ItemDataBoundEventArgs e)
RadListBoxItem listBoxItem = (RadListBoxItem)e.DataBoundItem;
// Add button
RadButtonElement btn =
StackLayoutPanel stackPanel = (StackLayoutPanel)listBoxItem.Children.Children;
stackPanel.Orientation = Orientation.Horizontal;
stackPanel.Children.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
Please note that the buttons will be aligned to the right depending on the length of the text. So if the strings have different sizes, the buttons will not be positioned in one 'column'.
If you want to have the buttons in one column, this should be done with the help of the Margin property. I am attaching a sample project which demonstrates the approach.
Another option for you is to use our RadGridView as RadListBox
. The column that you need in this case for the buttons is GridViewCommandColumn
I hope this helps. If you have additional questions, feel free to contact me.
All the best,
the Telerik team