Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2006, 09:15 AM
Authorized User
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with binding data in Datagrid

I have to bind data in datagrid when text entered in textbox.
how to write code in javascript function to bind data for datagrid?
Anyone please help me regarding this issue.
 
Old December 1st, 2006, 09:58 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi

Can u be more specific with your issue, its not possible to bind a datagrid via javascript, plz give more details of your issue so that we can assist accordingly.

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
 
Old December 2nd, 2006, 01:42 AM
Authorized User
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks For Ur Response,
 I Have to display the data in datagrid with respect to the entered text in textbox.For Example when i press 's',in datagrid data,which starts with 's' should be displayed and if i press next letter as 'o',
data with initial letters should be placed in datagrid and it should be dynamic.
 
Old December 2nd, 2006, 02:31 AM
Authorized User
 
Join Date: Sep 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No need for javascript here. U can safely write in code behind.plave a button , next to text box .In Its click event , write sql query and bind to datagrid.

eg.
string sql = "select * from customers where firstname like '" + textBox1.text + "'%"

If u are comfortable to do,Go Ahead, Or let us know.

Good Luck


 
Old December 5th, 2006, 08:00 AM
Authorized User
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
thanks for ur response.,But I want to provide user-friendly.,if I add a button there everytime user has to press this button every time when he enters text.So
pls give me any other idea.

Samatha

 
Old December 5th, 2006, 09:30 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jackstumpf
Default

you can put the code sugested by SriRamaKrishna on the Textbox's TextChanged event.

i would also like to suggest one other thing, if you have all the information you need to filter on the DataGrid, use a DataView to filter user entries instead of going all the way to you database to do justa that. :)
 
Old December 6th, 2006, 09:13 AM
Authorized User
 
Join Date: Sep 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

textchanged event of textbox does not post the page automatically.That event is fired only when page postback due to other conrols like button or dropdownlist(with autopost back true).

Hi Samatha , if u have only only one button ,then ther is no need to click the button.The page is posted whenever user types in textbox and press enter .






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in binding DataBound Column of DataGrid su General .NET 0 December 1st, 2006 02:21 PM
Data Binding Using DataGrid hoailing22 ASP.NET 1.0 and 1.1 Basics 17 November 14th, 2006 02:17 AM
problem in binding data vijjum3 General .NET 1 December 29th, 2004 08:41 AM
Binding Data to a DataGrid RPG SEARCH ASP.NET 1.0 and 1.1 Basics 5 August 9th, 2004 02:27 PM
Data Binding Problem jbenson001 ASP.NET 1.x and 2.0 Application Design 3 December 18th, 2003 01:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.