Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:29:07+00:00 2026-05-26T16:29:07+00:00

i am binding two table values in AutoCompleteExtender but my requirement is differentiate the

  • 0

i am binding two table values in AutoCompleteExtender but my requirement is differentiate the two tables apply the colors i.e table1 values apply red color and table2 values apply green color how to write the code pls give me any suggestion
my code is

 [WebMethod]
    public string[] GetCompletionList(string prefixText, int count)
        {
        if (count == 0)
        {
            count = 10;
        }
        DataTable dt = GetRecords(prefixText);
        List<string> items = new List<string>(count);

        for (int i = 0; i < dt.Rows.Count; i++)
        {          
            string strName = dt.Rows[i][1].ToString() + ',' + dt.Rows[i][0].ToString();             
            items.Add(strName);
            //items.Add(System.Drawing.Color.Red);

        }
        return items.ToArray();

    }

Getrecords code is

public DataTable GetRecords(string strName)
    {
        SqlCommand cmd = new SqlCommand("Usp_Consultant1", LITRMSConnection);

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@consultantname", strName);
                DataSet objDs = new DataSet();
        SqlDataAdapter dAdapter = new SqlDataAdapter();
        dAdapter.SelectCommand = cmd;
        LITRMSConnection.Open();
        dAdapter.Fill(objDs);
        LITRMSConnection.Close();
        return objDs.Tables[0];
    }

and stored procedure is

CREATE Procedure Usp_Consultant1
    (@consultantname varchar(100))
As
        Begin
            select  (cast(ConsultantID as varchar)+',Employee')as ConsultantID,(FirstName+LastName)as ConsultantName from Consultant  where FirstName+LastName like +@consultantname+'%'                
            union all           
            select  (cast(ConsID as varchar)+',NonEmployee')as ConsultantID,(Firstname+LastName)as consultantName from InDirectConsultant  where FirstName+LastName like +@consultantname+'%'   
            ORDER BY 1;
        End

pls give me any suggestion….

thank u
hemanth

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:29:07+00:00Added an answer on May 26, 2026 at 4:29 pm

    answer is add the javascript function

     function getCustomers_Populated(sender, e) {
    
            var customers = sender.get_completionList().childNodes;
            var searchText = sender.get_element().value;
    
            for (var i = 0; i < customers.length; i++) {
    
                var customer = customers[i];
                var customerValueArray = (customer._value).split(",");
                var customerId = customerValueArray[0];
                var type = customerValueArray[2];
                 customers[i].innerHTML = customerId;
                if (type == 'Employee') {
                    customers[i].style.backgroundColor = 'red';
                }
                else {
                    customers[i].style.backgroundColor = 'blue';
                }
    
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have asp:datalist binding from table this table contain two columns one of them
When data binding two elements together, how can I include the binding information AND
Two way binding does not work on my custom control with the following internals:
If you bind a control in a FormView using two way binding (such as
There are two types of query parameters binding in the Hibernate Query. One is
I've got a simple WPF dialog with these two controls: <TextBox Text={Binding MyText}/> <Button
I have two data tables in a data set for example lets say Servers:
In MySQL Im having two tables: PRODUCTS (id, Name) SEEALSO (id, prodLeft, prodRight) SEEALSO
Suppose I have a dataset with those two immortal tables: Employee & Order Emp
I have two tables that are related to each other in a 1-1 relationship

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.