0
infragistics webcombo
にtypeahead suggest
を使用しています。Infragistics webcombo先行提案
xmlReq
を使用してWebCombo1_InitializeDataSource
にアクセスすることができますが、データはwebcombo
には表示されません。以下は
私が使用していたコードの一部です:
<igcmbo:WebCombo ID="WebCombo1" runat="server" EnableXmlHTTP="True" Editable="True"
ComboTypeAhead="Suggest">
<Columns>
<ClientSideEvents EditKeyUp="WebCombo1_EditKeyUp">
</ClientSideEvents>
</igcmbo:WebCombo>
のJavascript機能:
function WebCombo1_EditKeyUp(webComboId,newValue,keyCode)
{
var oWebCombo1=igcmbo_getComboById(webComboId)
xmlReq = null;
if(window.XMLHttpRequest) xmlReq = new XMLHttpRequest();
else if(window.ActiveXObject) xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
var search=newValue&&newValue.length&&newValue.length>0?newValue:"";
xmlReq.open("GET","ActivityManagement.aspx?searchString="+search,true);
xmlReq.send(null);
}
コードを後ろに:
void WebCombo1_InitializeDataSource(object sender, Infragistics.WebUI.WebCombo.WebComboEventArgs e)
{
string str = "";
if (this.Request.QueryString["searchString"] != null)
{
str = this.Request.QueryString["searchString"].ToUpper();
}
else str = "00";
DataTable dtProducts = OperationsDataAccess.GetProductList(str);
string rowFilter = "DeleteFlag = 0";
dtProducts.DefaultView.RowFilter = rowFilter;
WebCombo1.DataSource = dtProducts.DefaultView;
WebCombo1.DataTextField = "Name";
WebCombo1.DataValueField = "Id";
WebCombo1.DataBind();
WebCombo1.DropDownLayout.RowSelectors = RowSelectors.No;
}