Hi @deejayns,
As @Geoffrey said, the focus function should not expand a ComboBox.
I would suggest to call the ComboBox's onTriggerClick function to expand it.
Also I can't see any reason to call reload for a Store in your case. Though it might be just an example, I understand.
Finally, here is the example how I would achieve that.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.DataBind(this.ComboBox1.GetStore());
}
}
protected void Store_RefreshData(object sender, StoreRefreshDataEventArgs e)
{
this.DataBind(sender as Store);
}
private void DataBind(Store store)
{
store.DataSource = new object[]
{
new object[] { 1,"France"},
new object[] { 2, "Canada"},
new object[] { 3, "Germany"},
new object[] { 4, "United States"},
new object[] { 5, "Italy"}
};
store.DataBind();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET Example</title>
<script type="text/javascript">
var reloadAndExpand= function (combo) {
var store = combo.getStore();
store.on("load", function () {
combo.onTriggerClick();
},
null,
{
single : true
});
store.reload();
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:ComboBox
ID="ComboBox1"
runat="server"
ValueField="Id"
DisplayField="Name"
Editable="true"
Mode="Local">
<Store>
<ext:Store runat="server" OnRefreshData="Store_RefreshData">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="Id" />
<ext:RecordField Name="Name" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
</ext:ComboBox>
<ext:Button
runat="server"
Text="Reload and expand"
OnClientClick="reloadAndExpand(ComboBox1);" />
</form>
</body>
</html>