Hi Lim,
My sincere appologies in the delay.
There is no built-in support for adding the null datasource to the AutoComplete component. But you can handle the onIntilaize method (in the TextBoxAutoCompleteCellRenderer) and add the one empty row datatable to the Autocomplete.Datasource. Please refer to the attached sample for more details.
//set the value into the cell control & initialize it
protected override void OnInitialize(int rowIndex, int colIndex)
{
// Immeditaly switch into editing mode when cell is initialized.
GridStyleInfo style = Grid.Model[rowIndex, colIndex];
try
{
AutoCompleteDataColumnInfo info = style.Tag as AutoCompleteDataColumnInfo;
object datasource = style.DataSource;
if( datasource == null)
{
DataTable dt = new DataTable("AutoCompleteTable");
dt.Columns.Add(new DataColumn("DisplayField"));
dt.Rows.Add(new object[]{string.Empty});
dt.AcceptChanges();
this.CurrentStyle.DataSource = style.DataSource = dt;
}
if( info == null )
{
info = new AutoCompleteDataColumnInfo("DisplayField",200,true);
this.CurrentStyle.Tag = style.Tag = info;
}
myTextBox.Text = style.CellValue.ToString();
this.autoComplete1.SetAutoComplete(this.myTextBox,AutoCompleteModes.Both);
this.autoComplete1.DataSource = style.DataSource;
autoComplete1.Columns.Clear();
autoComplete1.Columns.Add(style.Tag as AutoCompleteDataColumnInfo);
}
catch (Exception ex)
{
Syncfusion.Diagnostics.TraceUtil.TraceExceptionCatched(ex);
}
base.OnInitialize(rowIndex, colIndex);
}
Sample :
http://www.syncfusion.com/Support/user/uploads/TextBox_autocomplete_e6ff0fc.zipLet us know if this helps.
Best Regards,
Haneef