GridComboBoxColumn search problem
Hi,
I have a question, i have these code
new GridComboBoxColumn()
{
MappingName = "IdTercero",
HeaderText = "Tercero",
DataSource = l_terceros,
ValueMember = "Id",
DisplayMember = "Tercero",
ValidationMode = GridValidationMode.InEdit,
DropDownStyle = DropDownStyle.DropDown,
AutoCompleteMode = AutoCompleteMode.Suggest,
AutoSuggestMode = AutoCompleteSuggestMode.Contains,
AutoSuggestDelay = 300,
}
l_terceros is a list, the search works fine but if i search (xdasjdlasjdlasjdals) the combox show all results, it´s posible not show any information?
Thanks.
SIGN IN To post a reply.
4 Replies
1 reply marked as answer
MA
Mohanram Anbukkarasu
Syncfusion Team
November 6, 2020 01:30 PM UTC
Hi Ruben,
Thanks for contacting Syncfusion support.
We have checked the reported scenario in GridComboBoxColumn. We have used our SfComboBox as the edit element in the GridComboBoxColumn and the reported scenario is the behavior of SfComboBox. We have forwarded this query to the corresponding. We will update with further details on 10th November 2020. We appreciate your patience until then.
Regards,
Mohanram A.
MA
Mohanram Anbukkarasu
Syncfusion Team
November 10, 2020 01:44 PM UTC
Hi Ruben,
Thanks for your patience.
Your requirement can be achieved by creating a custom render for the GridComboBoxColumn as shown in the following code example.
Code example :
|
this.sfDataGrid.CellRenderers["ComboBox"] = new CustomComboBoxCellRenderer();
public class CustomComboBoxCellRenderer : GridComboBoxCellRenderer
{
SfComboBox comboBox = null;
protected override void OnInitializeEditElement(DataColumnBase column, RowColumnIndex rowColumnIndex, SfComboBox uiElement)
{
comboBox = uiElement;
uiElement.TextBox.TextChanged += UiElement_TextChanged;
base.OnInitializeEditElement(column, rowColumnIndex, uiElement);
}
private void UiElement_TextChanged(object sender, System.EventArgs e)
{
if (comboBox != null)
{
comboBox.DropDownListView.View.Filter = FilterItem;
comboBox.DropDownListView.View.RefreshFilter();
}
}
private bool FilterItem(object obj)
{
if (obj.ToString().ToLower().Contains(comboBox.TextBox.Text))
return true;
return false;
}
} |
We have prepared a sample using the above given code example and it is available in the following link for your reference.
Sample link : https://www.syncfusion.com/downloads/support/forum/159451/ze/SfDataGrid_ComboBoxColumn-1703264038
Please let us know if you have any concerns in this.
Regards,
Mohanram A.
Marked as answer
RU
Ruben
November 10, 2020 03:44 PM UTC
Thanks for the reply, we test it in our project and we tell you
MA
Mohanram Anbukkarasu
Syncfusion Team
November 11, 2020 04:44 AM UTC
Hi Ruben,
Thanks for the update.
We will wait to her from you.
Regards,
Mohanram A.
SIGN IN To post a reply.