15 Answers, 1 is accepted
Thank you for writing.
RadMultiColumnComboBox internally contains of RadGridView. It can be accessed from its EditorControl property. Here is a sample:
radMultiColumnComboBox1.EditorControl.Rows[0].Cells[
"YourColumnName"
].Value = someValue;
I hope that you find this information useful. Let us know if you have any other questions.
All the best,
Stefan
the Telerik team
your information was very good but I have 3 columns in my multicolumncombobox,one of them is check box column so i want to check & uncheck the chekboxes.
please help me how can i do it?(I know there is checkbox dropdown list in rad controls but its hard for me to use it)
It does not matter how many columns you have in your RadMultiColumnComboBox, simply use the code snippet from my previous post to modify the desired cell value. Attached you can also find a sample project for your convenience.
Let us know if you need anything else.
All the best,
Stefan
the Telerik team
I want to press Space Key on the CheckBox column and change the status of it,
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Random r = new Random();
DataTable table = new DataTable();
table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Bool", typeof(bool));
table.Columns.Add("DateColumn", typeof(DateTime));
for (int i = 0; i < 10; i++)
{
table.Rows.Add(i, "Row " + i, r.Next(10) > 5 ? true : false, DateTime.Now.AddHours(i));
}
radMultiColumnComboBox1.DataSource = table;
radMultiColumnComboBox1.EditorControl.CellClick += new Telerik.WinControls.UI.GridViewCellEventHandler(EditorControl_CellClick);
}
void EditorControl_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
if (e.Column.Name == "Bool")
((DataGridViewCell)sender).Value = true;
}
}
Thank you for writing.
In your code, you are trying to change the value of the check box when its cell is clicked. To do that, you need to cast to GridCheckBoxCellElement:
void
EditorControl_CellClick(
object
sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
if
(e.Column.Name ==
"Bool"
)
((GridCheckBoxCellElement)sender).Value = !(
bool
)((GridCheckBoxCellElement)sender).Value;
}
In order to be able to change the check box by pressing the space key, you need to handle the KeyDown event of the text box, and do that manually.
Both approaches are implemented in the attached project.
I hope that you find this information useful.
Kind regards,
Stefan
the Telerik team
I used your solution and this code to solve my problem,and I works.
radMultiColumnComboBox1.EditorControl.CellBeginEdit += new GridViewCellCancelEventHandler(EditorControl_CellBeginEdit);
void EditorControl_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
if (radMultiColumnComboBox1.EditorControl.CurrentColumn is GridViewCheckBoxColumn)
{
RadCheckBoxEditor editor = (RadCheckBoxEditor)CmboBox.EditorControl.ActiveEditor;
editor.ValueChanged += new EventHandler(editor_ValueChanged);
}
}
I am glad that your case is resolved. Just one small suggestion, change your code to the following in order to avoid multiple subscriptions to the same event:
void
EditorControl_CellBeginEdit(
object
sender, GridViewCellCancelEventArgs e)
{
if
(radMultiColumnComboBox1.EditorControl.CurrentColumn
is
GridViewCheckBoxColumn)
{
RadCheckBoxEditor editor = (RadCheckBoxEditor)CmboBox.EditorControl.ActiveEditor;
editor.ValueChanged -=
new
EventHandler(editor_ValueChanged);
editor.ValueChanged +=
new
EventHandler(editor_ValueChanged);
}
}
If you have any other questions, do not hesitate to contact us.
Regards,
Stefan
the Telerik team
I have another question .I add this part to my project
CmboBox.EditorControl.ReadOnly = false;
CmboBox.EditorControl.KeyDown += new KeyEventHandler(EditorControl_KeyDown);
void EditorControl_KeyDown(object sender, KeyEventArgs e)
{
MessageBox.Show("EditorControl_KeyDown");
}
but the Key Down Event doesnt happen .Ill be thankfull if you cold help me
The event indeed is not fired since the focus is in the EditableArea. Here is how to capture it:
radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.HostedControl.KeyDown +=
new
KeyEventHandler(TextBoxElement_KeyDown);
...
void
TextBoxElement_KeyDown(
object
sender, KeyEventArgs e)
{
//do smth
}
If this does now work for you, please let me know what is your scenario, so I can help you further.
Greetings,
Stefan
the Telerik team
can any one tell me that how can i store my value in radmultcolumncombobox without data base like i have a Radmulticlumncombobox and i want to store in this the names of week like sunday ,monday
RadMultiColumnComboBox internally hosts RadGridView, which can be accessed via the EditorControl property. Once you get a reference to the grid, you can use its API to populate it with data manually. Here is an article on the matter: http://www.telerik.com/help/winforms/gridview-populating-with-data-unbound-mode.html
Off topic, please try to separate the questions that are not related to each other in separate threads. We are trying to keep one subject per thread. Thank you for the understanding.
Regards,
Stefan
Telerik
Hi Telerik,
Here I have a RadMultiColumnComboBox with multiple selection (I used RadMultiColumnComboBoxSelectionExtender for multiple selection as you referred from here)
Its working fine, but there the value suggesting only from Display member column when we typing
- I need filter with all columns what i suggesting here.
- and How could i get the selected columns value member collection to table
Can you do any demo for with this requirements
Thank you
my code is here
CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor();
compositeFilter.FilterDescriptors.Add(new FilterDescriptor("Name", FilterOperator.Contains, ""));
compositeFilter.FilterDescriptors.Add(new FilterDescriptor("Code", FilterOperator.Contains, ""));
compositeFilter.LogicalOperator = FilterLogicalOperator.Or;
RadMultiColumnComboBox1.EditorControl.FilterDescriptors.Add(compositeFilter);
The RadMultiColumnComboBoxSelectionExtender is quite a custom and complex implementation allowing you to display tokens in the editable part indicating the multiple rows that are selected. Since it uses a RadAutoCompleteBoxElement, the list with suggestions comes from the embedded RadAutoCompleteBoxElement, not the popup grid itself. That is why you can see a simple list of matches, no the entire grid.
The CompositeFilterDescriptor uses the default input text box in the editable area of RadMultiColumnComboBox and it relies that only a single text is displayed in the editable part. I can give you the following suggestion for extending the custom implementation: RadGridView supports custom filtering functionality which is a flexible mechanism for filtering RadGridView rows by using custom logic. It has a higher priority than the applied FilterDescriptors (added either by code or using the filtering row). You can combine it with the existing custom implementation with the RadAutoCompleteBoxElement and its autocomplete list with suggestions. Additional information how this filtering works is available in the following articles:
https://docs.telerik.com/devtools/winforms/controls/gridview/filtering/custom-filtering
https://www.telerik.com/support/kb/winforms/multicolumncombo/details/use-custom-filtering-to-search-in-radmulticolumncombobox
I hope this information helps.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Hi Dess,
Thank you for Your fast reply,
You decided to me custom filtering option, That working fine simply.
But if I add the RadMultiColumnComboBoxSelectionExtender there losing the custom filtering property automatically .
At that time filtering only with the column of value member.
actually you got my question.
I need a tool with the combination of RadMultiColumnComboBox and RadCheckedDropDownLis
can you please Forward any demo with including my requirements.
my Requirements are
- multi column filtering or suggesting like multicolumncomboBox
- multi selection like checkeddropdownlist
- "check all" property should there
- the checked values to data table
Thank you.
In order to achieve your goal, I can suggest you several approaches:
1. RadCheckedDropDownList combines RadDropDownList and RadAutoCompleteBox in order to provide functionality to check items in the drop down area out of the box and tokenize them in the text area. All previous functionality is preserved, such as visual formatting, auto-complete functionality and data binding, which is now extended. In order to simulate the grid like design, you can construct custom visual items and display more information than a single column. A sample approach is demonstrated here: https://docs.telerik.com/devtools/winforms/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/custom-items This approach provides the necessary functionality out of the box and you need just to customize the design a little bit which makes this approach easier than the other ones.
2. Use the default behavior of the CompositeFilterDescriptors to filter by multiple columns the records in the popup grid. But, for this purpose, you need to have a single text in the editable area of RadMultiColumnComboBox. You can add a boolean field displayed by a GridViewCheckBoxColumn to control whether the record is checked or not.
3. The RadMultiColumnComboBoxSelectionExtender actually uses the autocomplete popup of the RadAutoCompleteBox. The suggestions are filled considering the applied DisplayMember in RadMultiColumnComboBox. That is why the custom filtering is not triggered at all in this case. If you want to force the custom filtering behavior to be triggered, you need to handle the RadAutoCompleteBox.TextChanged event. Then, set the RadMultiColumnComboBox.Text to the last entered input (which is not a token yet), call the MultiColumnComboBoxElement.ShowPopup and RadMultiColumnComboBox.EditorControl.MasterTemplate.Refresh methods and then the CustomFiltering event will be fired. But this will allow you to filter the items in the popup grid, not the suggestions of the integrated RadAutoCompleteBox. You will need to further extend the custom behavior which may take some time and would need additional custom implementation. This will make more complex this approach and it will need tough maintenance in future. That is why I would recommend you to use one of the previous two suggested approaches.
Feel free to use this approach which suits your requirements best.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik