Its possible add a filter of checks selected or not, and change item color according to index selected?
I use class radmultiColumnCombobox.
6 Answers, 1 is accepted
Hello, Mario,
According to your brief description and attached pictures, it seems that you use multiple selections in RadMultiColumnComboBox. I suppose that you follow the example shown in the following article: https://docs.telerik.com/devtools/winforms/controls/multicolumncombobox/how-to/multiple-selection
If I understand you would like to change the row color of the selected items. In order to achieve this, you can use the ViewCellFormatting event and change the row color according to the state of its checkbox:
void EditorControl_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
RadCheckBoxElement checkBox = e.CellElement.FindDescendant<RadCheckBoxElement>();
if (checkBox.CheckState == CheckState.Checked)
{
e.CellElement.RowElement.BackColor = Color.Red;
}
else
{
e.CellElement.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
}
You can see the achieved result in the attached gif file.
According to the question in your second post, note that you can see all the checked items when you click on the arrow button. Thus, the autocomplete text box that hosts the checked items will automatically adjust its height in order to display all items:
I hope this information helps. If you have further questions please let me know.
Regards,
Nadya
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Nadya, thanks for replying. That is correct, I am using multiple selection.
I want to change the color but in the autocompleteBox according to the selected index. I have already resolved this question with the event:
void autoCompleteBoxElement_TextBlockFormatting(object sender, TextBlockFormattingEventArgs e)
on the other hand
"According to the question in your second post, note that you can see all the checked items when you click on the arrow button. Thus, the autocomplete text box that hosts the checked items will automatically adjust its height in order to display all items"
Please try the gif example and select 6 items, and it does not adjust automatically. (ejemplo2.png)
thanks for your time
Hello, Mario,
Please excuse me that I did not get you right that you would like to change the color for the items in the autocomplete text box, instead I provided a solution for coloring the rows in the grid. Providing accurate information of the desired behavior in the begging is of high importance to us since we suggest our solutions based on the information we have so far. This is why I highly recommend you to give more clear information about the desired behavior that you would like to achieve. Thus, we would be able to provide more accurate solutions that resolve your problem. However, I am glad that you managed to find a working solution for coloring the items in the text box field.
According to your second question, in order to make the text box autosize when there are more items added you should close the drop-down in order to redraw the text box and adjust its height. This can be done in the DropDownClosing event as shown below:
void radMultiColumnCombobox1_DropDownClosing(object sender, RadPopupClosingEventArgs args)
{
//...
args.Cancel = false;
}
I hope this helps. Let me know if you have other questions.
Regards,
Nadya
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).
thanks Nadya,
I have another question and I have no idea how to do it, I would like to add a check that allows me to see only the active checks.
thanks for your attention
Please have in mind that the displayed tokens in the editable area actually show which items are checked in the drop down. If I understand you correctly, you want to add an option to show or hide the checked items.
I believe that the custom filtering functionality that RadGridView offers would fit you needs: https://docs.telerik.com/devtools/winforms/controls/gridview/filtering/custom-filtering
You have access to the popup grid via the RadMultiColumnComboBox.EditorControl property. Thus, if the custom filtering is enabled, you can control whether a row is visible or not via the GridViewCustomFilteringEventArgs.Visible if the Handled argument is set to true in the CustomFiltering event.
Please give this approach a try and see how it would work for your scenario.
Should you have further questions please let me know.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.