473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to apply autocomplete in gridview (in asp.net3.5 with C#) using jquery?

I want to apply autocomplete in gridview (in asp.net3.5 with C#) using jquery and this

gridview is within the ajax update panel

Expand|Select|Wrap|Line Numbers
  1. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  2.     <ContentTemplate>
For this i am using method within the <ItemTemplate>

Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function(){
  2.     $('[id$=txtItemCode]').autocomplete("SearchItem.aspx").result(function (event, data, 
  3.  
  4. formatted) {
  5.         if (data) {
  6.             alert('Value: '+ data[1]);
  7.  
  8.         }
  9.         else {
  10.             $('[id$=txtItemID]').val('-1');
  11.         }
  12.     });
  13.     });
since in gridview the textbox id is <asp:TextBox id="txtItemCode" /> but

on browser such as
Expand|Select|Wrap|Line Numbers
  1. <input type="textbox" id="ctl00_otherName_101txtItemCode" />
and then for the next row same textbox id is now
Expand|Select|Wrap|Line Numbers
  1. <input type="textbox" id="ctl00_otherName_102txtItemCode" />
i tried
1. put this code within the <ItemTemplate>
2. <%= txtItemCode.ClientID %>
3. jQuery("*[@id$=theGridId] input[@id$=txtItemCode]")
4. jQuery("*[id$=theGridId] input[id$=txtItemCode]")
5.jQuery.expr[':'].asp = function(elem, i, match) {
return (elem.id && elem.id.match(match[3] + "$"));
};
and $(":asp(txtItemCode)").autocomplete...
5.$('.txtItemCode').autocomplete("LookupCodes.aspx ?type=IC", { mustMatch: true })

but autocomplete for textboxfield in multiple rows does not work in all the cases
Feb 2 '11 #1
0 2127

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Daves | last post by:
within a (2.0) GridView I have a hyperlink for editing row but I only want it to be visible if the current user is admin. So I thought <Columns> <asp:HyperLinkField DataTextField=""...
0
by: coosa | last post by:
Dear all, I tried to replace the GridView Column's HyperLinkField "DataNavigateUrlFormatString" property with a java script pop up window, but wehen i preview the page, the link is REMOVED! Does...
0
by: Dom | last post by:
Hello This should work I know ... but.. with your help perhaps.. Trying to assign a 'selectparameter' to an objectdatasource nested within a gridview EditItemTemplate. When I try to access...
1
by: Nam | last post by:
I have a DropDownList control in a TemplateField inside my GridView How do I access this control’s SelectedIndexChanged event in codeBehind page? I don’t see the ID “DropDownList1” of...
0
by: dawg1998 | last post by:
I am able to populate a DropDownList control within multiple rows of a GridView with the following code: `````````````````````````````````````````````````````` <asp:GridView id="gvGridView"...
14
by: Mike | last post by:
I have a gridview that has a button in the last cell of each row. I want to get the text from cell 1 for that row the button was clicked on. So if my gridview looks like this: N-12 BMW ...
1
by: Cirene | last post by:
This is confusing... I have a gridview (gv1) with another gridview (gv2) inside of it. gv1 has a bunch of house listings and within each row is a group of related house pictures (gv2). I'm...
5
by: Mike | last post by:
Hi, I use MS SQL Express and VS 2005 c#, win application. I would like to select value rom DateTimePicker and list all values for selected date within GridView. I have method as follows: ...
1
by: anasrazvi | last post by:
Hello All, I am implementing autocomplete functionality for a textbox inside a gridview. For this I am using a Div control to place the data based on the prefix key entered inside textbox. As...
0
by: eshwaramoorthy | last post by:
Hi, i hav a dropdownlist within gridview.and if i select that particular value in dropdownlist the value should get updated. pls send me coding. thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.