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

December 1st, 2006, 09:15 AM
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

December 1st, 2006, 09:58 AM
|
Friend of Wrox
|
|
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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.
|

December 2nd, 2006, 01:42 AM
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

December 2nd, 2006, 02:31 AM
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 5th, 2006, 08:00 AM
|
Authorized User
|
|
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 5th, 2006, 09:30 AM
|
Registered User
|
|
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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. :)
|

December 6th, 2006, 09:13 AM
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 .
|
|
 |