
Hi,
I am trying to customize the appearance of the list view item and I followed the Shopping Cart List View example at the below location -
https://docs.telerik.com/devtools/winforms/knowledge-base/shopping-cart-lsitview-custom-item
The list view item is divided into two StackLayout elements and each element has further UI elements and buttons. The entire item is divided into 2 halves. I need to define the width of the each StackLayout element such that the element on the left occupies around 70% of the item width and the one on the right to have a 30% width.
Attached is an image for reference which shows the item is split into 2 halves.
A sample code or pointers would be great.
Below is the code for the visual item as well.
using System;using System.Drawing;using System.Windows.Forms;using Telerik.WinControls.UI;using WFAInterplayPOS.Model.DataModel.Cart;using WFAInterplayPOS.Service;namespace WFAInterplayPOS.UserIterface.Restaurant{ public class ActiveCartVisualItem : SimpleListViewVisualItem { // Add button. private RadButtonElement AddButtonElement; // Remove button. private RadButtonElement RemoveButtonElement; // Details layout private StackLayoutElement DetailsStackLayout; // Buttons layout. private StackLayoutElement ButtonsStackLayout; // Title. private LightVisualElement TitleElement; // Viewitem layout. private StackLayoutElement ViewItemLayout; // Amount label. private RadLabelElement AmountLabelElement; /* * Overridden CreateChildElements() * * */ protected override void CreateChildElements() { // base.CreateChildElements(); base.CreateChildElements(); // Viewitem layout. ViewItemLayout = new StackLayoutElement { Orientation = Orientation.Horizontal, ShouldHandleMouseInput = false, NotifyParentOnMouseInput = true, StretchHorizontally = true }; // Build details layout. BuildDetailsLayout(); // Build buttons layout. BuildButtonsLayout(); // Add the visual elements. ViewItemLayout.Children.Add(DetailsStackLayout); ViewItemLayout.Children.Add(ButtonsStackLayout); Children.Add(ViewItemLayout); } /* * BuildDetailsLayout() * * */ private void BuildDetailsLayout() { // Details layout. DetailsStackLayout = new StackLayoutElement { Orientation = Orientation.Vertical, ShouldHandleMouseInput = false, NotifyParentOnMouseInput = true, StretchHorizontally = true, Margin = new Padding(3, 3, 3, 3) }; // Title element. TitleElement = new LightVisualElement { TextAlignment = ContentAlignment.MiddleLeft, StretchHorizontally = true, ShouldHandleMouseInput = false, NotifyParentOnMouseInput = true }; DetailsStackLayout.Children.Add(TitleElement); // Amount label. AmountLabelElement = new RadLabelElement { Margin = new Padding(0, 3, 0, 3), TextAlignment = ContentAlignment.MiddleLeft }; DetailsStackLayout.Children.Add(AmountLabelElement); } /* * BuildButtonsLayout() * * */ private void BuildButtonsLayout() { // Buttons layout. ButtonsStackLayout = new StackLayoutElement { Orientation = Orientation.Horizontal, ShouldHandleMouseInput = false, NotifyParentOnMouseInput = true, StretchHorizontally = true, StretchVertically = true }; // Remove button. RemoveButtonElement = new RadButtonElement { Margin = new Padding(3, 6, 0, 6), Text = "<html><size=13><b>-</b>", StretchVertically = true, }; RemoveButtonElement.Click += RemoveButtonElement_Click; ButtonsStackLayout.Children.Add(RemoveButtonElement); // Add button. AddButtonElement = new RadButtonElement { Margin = new Padding(0, 6, 3, 6), Text = "<html><size=13><b>+</b>", StretchVertically = true, }; AddButtonElement.Click += AddButtonElement_Click; ButtonsStackLayout.Children.Add(AddButtonElement); } /* * AddButtonElement_Click() * * */ private void AddButtonElement_Click(object sender, EventArgs e) { } /* * RemoveButtonElement_Click() * * */ private void RemoveButtonElement_Click(object sender, EventArgs e) { } protected override void SynchronizeProperties() { // base.SynchronizeProperties() base.SynchronizeProperties(); // Other attributes. Text = ""; var data = Data.DataBoundItem as LineItem; TitleElement.Text = "<html><size=10>" + data.quantity + " x " + data.name; AmountLabelElement.Text = "<html><size=10><color=red>" + data.subTotal.amount.ToString("C"); } protected override Type ThemeEffectiveType { get { return typeof(SimpleListViewVisualItem); } } }}
Thanks.

Hi All,
I have added a custom column or cell containing DrodownList -its appearing correctly in view mode.
Now I have below points :
1. On which event of the GridView I can bind the dropdownList.
2. When I select any value (Currently have added some static value in the DropdownList). Once I scroll the grid , the state changes to original state.
3. Some time I noticed that the value i selected for let say row one, the same value is being selected for the the row which is not displayed. after scrolling we can see the same. and the value of 1st row got removed.
4. My requirement is -
Attaching my code of custom cell
class CustomDropCell : GridDataCellElement { private string conString { get; set; } public CustomDropCell(GridViewColumn column, GridRowElement row): base(column, row) { //conString = con; } private StackLayoutPanel panel; private RadDropDownListElement radDropDownList; protected override void CreateChildElements() { base.CreateChildElements(); this.panel = new StackLayoutPanel(); this.panel.Margin = new System.Windows.Forms.Padding(5); this.panel.Orientation = System.Windows.Forms.Orientation.Vertical; this.radDropDownList = new RadDropDownListElement { DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList }; this.radDropDownList.Items.Add("Santosh"); this.radDropDownList.Items.Add("Jha"); this.radDropDownList.Items.Add("Mr"); this.radDropDownList.Items.Add("Kumar"); this.Children.Add(radDropDownList); } protected override void SetContentCore(object value) { GridViewGroupRowInfo row = this.RowInfo as GridViewGroupRowInfo; object cellValue = value; if (cellValue is DBNull || cellValue == null) cellValue = "Mr"; this.radDropDownList.SelectedValue = cellValue; } protected override Type ThemeEffectiveType { get { return typeof(GridDataCellElement); } } public override bool IsCompatible(GridViewColumn data, object context) { return base.IsCompatible(data, context); // return data is CustomDropCellColumn && context is GridDataRowElement; } } public class CustomDropCellColumn : GridViewDataColumn { //private string conString { get; set; } public CustomDropCellColumn(string fieldName) : base(fieldName) { //conString = connectionString; } public override Type GetCellType(GridViewRowInfo row) { if (row is GridViewDataRowInfo) { return typeof(CustomDropCell); } return base.GetCellType(row); } }
Adding the column in Grid in Form Constructor.
CustomDropCellColumn customColumn = new CustomDropCellColumn("Destination Table"); customColumn.MaxWidth = 170; this.radGridViewTable.Columns.Add(customColumn); this.radGridViewTable.Columns["Destination Table"].MinWidth = 165;
I need to use dropdownlist as RadGridView editor
and I have look into this
https://docs.telerik.com/devtools/winforms/controls/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor
In the sample above,it bound a datasource to the dropdownlist editor,but only handle the display text and control value by overiding the "Value" property.
If I want to bind a datasource with valuemember and displaymember,how to handle them properly?What I expect is to let user choose with the displaymember and valuemember can be saved according to what user choose just like the normal checkeddropdownlist control.


Hi,
I have a TableLayoutPanel that is divided to 3 rows. Each row contains a RadPanel.
Only the middle one is causing transparency issue because it's not filled with controls.
how can I get rid of this issue?
Thanks,
Karoon

Hi all,
I just encountered the most bizarre thing today while using the Rich Text Editor. I upgraded our Telerik DLLs to the most recent one available (2019 R2, 2019.2.618) and it seems like the ability to paste into the Rich Text Editor has been lost all of a sudden. I tried all I could and looked around the forums a bit to no avail. The interesting thing is that when I debug, I can "hit" the CommandExecuting event and I can see that in the code it recognizes that it is a paste command, but the text is not being pasted onto the textbox.
private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is PasteCommand)
{
//the event is fired and recognizes that IT IS a PASTE COMMAND, but text is not being pasted onto the textbox
}
}
Has anyone else encountered this before. If so, can anyone point me to the right direction as to why this is happening? Thanks all.
Romel

I have a RadCheckedDropDownList that I am binding a BindingList to it. Some of the items in the list will have the CheckedMember property filled in. However, after the control loads, the items that are checked do not show up in TEXT area of the control. However, if you open the dropdown, you can see items checked. As soon as you uncheck or check an item, all the checked items do show up. This is a problem, I need the items that are checked by default to show up in the TEXT area. Below is my code that I use to bind my list to the control. Am I missing something?
private static void BindList (this RadCheckedDropDownList radDropDownList, BindingList<CheckedListItem> dropDownList, string valueMember = "Key", string displayMember = "Value", string checkedMember = "Checked")
{
radDropDownList.BeginUpdate();
radDropDownList.ValueMember = valueMember;
radDropDownList.DisplayMember = displayMember;
radDropDownList.CheckedMember = checkedMember;
radDropDownList.DataSource = dropDownList;
radDropDownList.EndUpdate();
radDropDownList.SelectedIndex = -1;
}

