This is a migrated thread and some comments may be shown as answers.

change color and filter multiple selection rmccbox

6 Answers 228 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 1
Mario asked on 24 Aug 2020, 03:03 PM

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

Sort by
0
Mario
Top achievements
Rank 1
answered on 24 Aug 2020, 03:14 PM
other issue is when i select multiple items in time execution, the grid not move and i cant see the new items.
0
Nadya | Tech Support Engineer
Telerik team
answered on 27 Aug 2020, 12:19 PM

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/.

0
Mario
Top achievements
Rank 1
answered on 27 Aug 2020, 02:49 PM

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

 

0
Nadya | Tech Support Engineer
Telerik team
answered on 28 Aug 2020, 03:53 PM

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).

0
Mario
Top achievements
Rank 1
answered on 31 Aug 2020, 10:08 PM

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

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Sep 2020, 06:47 AM
Hello, Mario,

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/.

Tags
MultiColumn ComboBox
Asked by
Mario
Top achievements
Rank 1
Answers by
Mario
Top achievements
Rank 1
Nadya | Tech Support Engineer
Telerik team
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or