views:

398

answers:

1

Hi i am using infragistics webcombo with the typeahead suggest

the problem is iam able to reach the WebCombo1_InitializeDataSource using the xmlReq but the data is not visible in the webcombo

below is the piece of code iam using.



javascript function

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);
   }

codebehind

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;        
}

Thanks

A: 

you can achieve this by simply

set the following property of the webcombo EnableXmlHTTP="True" Editable="True" ComboTypeAhead="Suggest"

and

bind the web combo with the datasource in the InitializeDataSource event of the webcombo and also bind the webcombo in the page_load when the page.ispostback is true

implement the search logic in your stored procedure eg select * from employee where emp_name like 'a%'

this will retrive the records as and when you keey in the data.

muthu