I am trying to make an AutoComplete Combobox in InfragisticsGridControl..
Please provide me sample code...
Thanks..
Frank100 said:I am trying to make an AutoComplete Combobox in InfragisticsGridControl..
First you have to set, through design mode which is easier or programatically, the "Style" of the column: DropDownValidate.
After that, you have to fill a ValueList with the values available for the combobox column in the grid:
void SetGridComboBoxValues(List<object> values){ if (grid.DisplayLayout.ValueLists.IndexOf("ComboValues") == -1) { grid.DisplayLayout.ValueLists.Add("ComboValues"); } else { grid.DisplayLayout.ValueLists["ComboValues"].ValueListItems.Clear(); }
grid.DisplayLayout.ValueLists["ComboValues"].ValueListItems.Add(null, "-- select --"); foreach (object value in values) { grid.DisplayLayout.ValueLists["ComboValues"].ValueListItems.Add(value, value.Name); }
grid.DisplayLayout.ValueLists["ComboValues"].DisplayStyle = ValueListDisplayStyle.DisplayText; grid.DisplayLayout.Bands[0].Columns["ColumnKey"].ValueList = grid.DisplayLayout.ValueLists["ComboValues"];}
"ColumnKey" is the key you have set to the column in which you want the combobox to appear, and "ComboValues" has to be an unique string that identifies the ValueList in the ValueLists collection.
Hope this helps,
Emanuel
{
TextBox textBx = e.Control as TextBox;
* Only if the column index of the current cell is
* "The one for which we need autocomplete functionality"
*/
* "BackGround COLORING" :
* Cleaning the existing EventHandlers
textBx.TextChanged -=
* Adding new event handler.
textBx.TextChanged +=
//Populating the 'custom datasource' values.
"valuea","valueab","valueabc",
"a12","a123","a123def",
//Setting to Suggest mode.
//Setting the source to the above created custom suggest datasource.
}
* Resetting the edited control's Autocomplete flags
* is NOT "THE AUTOCOMPLETE ONE" then is undo the effects for the Autocomplete edit settings
textBx.AutoCompleteCustomSource.Clear();
Can we do same with InfragisticsGridControl[ultraGrid1]...
Please provide me code...
Thanks...
I am using Version6.3
Might want to check out the new features in 2008 volume 2.
Nick