Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all,
i want to show suggested data in a table manner so how can i do

code used
XML
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div style=" margin-top:10px; margin-left:100px;">
   Search
        <asp:TextBox ID="TextBox1" runat="server" Width="500px"></asp:TextBox>
        <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="TextBox1"
         MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="10" CompletionInterval="100"
         FirstRowSelected="true" ShowOnlyCurrentWordInCompletionListItem="false"
          ServiceMethod="SelectMatchAgencies" ServicePath="~/FilterRecord.asmx" CompletionListElementID="pnlAutoCompleteResult"
          >
        </cc1:AutoCompleteExtender>

        <asp:Panel ID="pnlAutoCompleteResult" runat="server" Height="200px" ScrollBars="Vertical" />


HTML
public string[] SelectMatchAgencies(string prefixText, int count)
    {
        List<string> lstAgencies = new List<string>();
        BaseClass objBase = new BaseClass();
        clsAdm_co_agencies objAgency = new clsAdm_co_agencies();
        objAgency.Mga_id = objBase.nMgaId;
        objAgency.Search_text = prefixText;
        DataTable dtAgencies = objAgency.SearchAgenciesByCodeOrName();
        string strAgency = string.Empty;
        
        

        foreach (DataRow drAgy in dtAgencies.Rows)
        {
            //strAgency = "<span style='color: red;'>" + Convert.ToString(drAgy["agency_code"]) + " | " + Convert.ToString(drAgy["agency_name"]) + " | " + Convert.ToString(drAgy["agency_email"]) + " | " + Convert.ToString(drAgy["agency_physical_phone"]) + "</span>";
            strAgency = Convert.ToString(drAgy["agency_code"]) + " | " + Convert.ToString(drAgy["agency_name"]) + " | " + Convert.ToString(drAgy["agency_email"]) + " | " + Convert.ToString(drAgy["agency_physical_phone"]);
            //strAgency = "(" + Convert.ToString(drAgy["agency_code"]) + ") " +"~~"+ Convert.ToString(drAgy["agency_name"]);
            lstAgencies.Add(AutoCompleteExtender.CreateAutoCompleteItem(strAgency,strAgency));
        }
        return lstAgencies.ToArray();
    }


here i display code as well as name of agency but there are some different different length so i look not good
so i want to diaplay it in table format

please help me

thanks
Posted
Comments
ZurdoDev 11-Jul-12 15:06pm    
This is not clear. What part of the code is not working?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900