Hello,
Am using Rad grid view with Multi column combo box.
I created a Column type as GridViewMultiComboBoxColumn, attached the data source, also included the displaymember, valuemember,dropdwonstyle as RadDropDownStyle.DropDown. and added the column to the grid.
I am facing a problem that if i type in the GridView MultiComboBox Column, the control is not filtering and showing result.
I got a documentation saying
The drop-down element is an object of type MultiColumnComboBoxElement. Use this element to set the drop-down style, animation and sizing as you would do for the regular combobox.
The EditorControl property of the MultiColumnComboBoxElement gives you a reference to the RadGridView control. Using that reference you can obtain the RadGridView object and work as with normal RadGridView control. Refer to RadGridView documentation for additional information on RadGridView.
The current version has one limitation that you should consider:
You cannot use the auto-complete mode of RadDropDownList
The RadGridView control hosted in the drop-down does not allow editing operations
The RadGridView control hosted in the drop-down does not support filtering, grouping and sorting operations.
kindly confirm me is it a limitation or do i need to include something else in my code.
I am including the code snip shot for your ref.
bool isColumnAdded=false;
private void Form1_Load(object sender, EventArgs e)
{
filldata();
}
private void filldata()
{
SqlCommand cmmdata = new SqlCommand();
cmmdata.Connection = constkbal;
cmmdata.CommandText = "select top 50 stockno from itemmaster";
SqlDataReader srdtls = cmmdata.ExecuteReader();
DataTable dtdetails = new DataTable();
dtdetails.Load(srdtls);
srdtls.Close();
GridViewMultiComboBoxColumn col = new GridViewMultiComboBoxColumn();
col.DataSource = dtdetails;
col.DisplayMember = "stockno";
col.ValueMember = "stockno";
col.FieldName = "stockno";
col.HeaderText = "stockno";
col.Width = 400;
col.DropDownStyle = RadDropDownStyle.DropDown;
col.FilteringMode = GridViewFilteringMode.DisplayMember;
this.griditemdisplay.Columns.Add(col);
}
private void griditemdisplay_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
if (this.griditemdisplay.CurrentColumn is GridViewMultiComboBoxColumn)
{
if (!isColumnAdded)
{
isColumnAdded = true;
RadMultiColumnComboBoxElement serchengineElement = (RadMultiColumnComboBoxElement)this.griditemdisplay.ActiveEditor;
serchengineElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
serchengineElement.DropDownMinSize = new Size(550, 300);
serchengineElement.DropDownMaxSize = new Size(550, 300);
serchengineElement.EditorControl.MasterTemplate.AutoGenerateColumns = false;
serchengineElement.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
serchengineElement.AutoSizeDropDownToBestFit = false;
serchengineElement.DropDownAnimationEnabled = false;
serchengineElement.EditorControl.Columns.Add(new GridViewTextBoxColumn("Stockno"));
FilterDescriptor filtercustomername = new FilterDescriptor("Stockno", FilterOperator.Contains, string.Empty);
serchengineElement.EditorControl.FilterDescriptors.Add(filtercustomername);
}
}
}