Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have one textboox and one gridview. i want to do bind gridview dynimically by passing text of textbox,without taking more time ,
Posted
Updated 6-Oct-13 9:34am
v3
Comments
Pradeep Shukla 6-Oct-13 20:48pm    
What have you tried till now.. which column \ cell of the grid you want to get the updates from the text box. Its not clear from the question above. It needs to have more info if you want more help.
Naresh1277 6-Oct-13 23:40pm    
This is not a good question - we cannot work out from that little what you are trying to do. Remember that we can't see your screen, access your HDD, or read your mind. Without your code, we have even less idea that you do! Post the relevant code fragment, and we'll have a look... Use the "Improve question" widget to edit your question and provide better information.

hello professional
there is TextChanged event of text box control that can help you do this...

like:
C#
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
try
{
//here you get your value

String Value= TextBox1.Text.ToString();

//here you can call a method where you already binded your grid
   BindGrid(Value);
}
catch(Exception ex)
{
//show your Exception
}
}




for more go throw this...

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.textchanged.aspx[^]

Happy to help!!!
 
Share this answer
 
v4
i have created
C#
protected void txtSearch_TextChanged(object sender, EventArgs e)
   {
        GEtUsernamendRoleofUser user=new GEtUsernamendRoleofUser();
        SearchEmployeeByNameInput userinput=new SearchEmployeeByNameInput();
        SearchEmployeeByNameOutput useroutput = new SearchEmployeeByNameOutput();
        userinput.First_Name = txtSearch.Text;
        useroutput = user.Execute(userinput);
      
        gridviewbatch.DataSource = useroutput.DtEmployeeSearch;
        gridviewbatch.DataBind();
        
        for (int i = 0; i < gridviewbatch.Rows.Count; i++)
        {
            String lbl = ((Label)gridviewbatch.Rows[i].FindControl("lblrole")).Text;
            Label role = (Label)gridviewbatch.Rows[i].FindControl("UserRole");
            if (lbl.Equals("1"))
            {
                role.Text = "Admin";
            }
            else if (lbl.Equals("2"))
            {
                role.Text = "Employee";

            }
            else if (lbl.Equals("3"))
            {
                role.Text = "Parent";
               
            }
            else if (lbl.Equals("4"))
            {
                
                role.Text = "Student";
            }
        }
        if (useroutput.NoOfRows == 0)
        {


            lblsubjectmassageshow.Text = "No user found!";
            lblsubjectmassageshow.Visible = true;
        }
        else
        {
            lblsubjectmassageshow.Visible = false;
        }  
   }



but i want to create like google when change text in textbox than page refreshing is very fast .
 
Share this answer
 
v2

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