Fill Gridview using tab [Resolved]

Posted by Anweshabhowmick under Regular Expressions on 5/12/2011 | Points: 10 | Views : 2738 | Status : [Member] | Replies : 10
I have a gridview and a textbox.......After putting some no when i press tab the Gridview will fill.....without pressing any button

Is it possible.....pls any one can help...

It is very urgent....

Anwesha




Responses

Posted by: Lakn2 on: 5/12/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
<asp:Textbox id="tb1" runat="server" AutoPostBack="true" onTextChaneged="tb1_TextChanged">

protected void tb1_TextChanged(object sender,EventArgs)
{
sqldataadapter da=new sqldataadapter("select * from tablename where colname="+tb1.text,cn);
datatable dt=new datatable();
da.fill(dt);
gridview1.datasource=dt;
gridview1.databind();
}

i hope it helps you

Thanks&Regards
LakshmiNarayana Nalluri.

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 5/12/2011 [Member] [MVP] Starter | Points: 50

Up
0
Down

Resolved



check it u set it or not txtpono property AutoPostBack=True . . check it . .

Best Regard's
Prabhakar

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 5/12/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
hi Anweshabhowmick

i think Lkn2 say right . . u write code on TextBox1_TextChanged event . .

Best Regard's
Prabhakar

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anweshabhowmick on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
This Code is not working


Thanks For posting

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 5/12/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Anweshabhowmick

u run ur code Debug. . and firstly check ur texChanged Event Fired or not . . Then check where's the mistake to fill ur gridview . . Show ur code . .

Best Regard's
Prabhakar

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anweshabhowmick on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
My event is not fired.........

Here is the code...

private void loadgridquot()
{

bl.Connection_String = _connection_str;
bl.PO_No = txtpono.Text.ToString();


DataSet ds = new DataSet();

try
{
ds = bl.Search_PO_Detail_ByPONo();
if (ds.Tables[0].Rows.Count > 0)
{
gvpodetls.DataSource = ds;
gvpodetls.DataBind();
}
else
{
gvpodetls.DataSource = null;
gvpodetls.DataBind();
}
}
catch (Exception exx)
{
ds.Dispose();

}
finally
{
ds.Dispose();
}
}

protected void txtpono_TextChanged(object sender, EventArgs e)
{
loadgridquot();
}

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anweshabhowmick on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
Thank u so much.......U solved my huge problem............Thank u so much........
Anwesha


Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anweshabhowmick on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
Can u help me Nested grid with adding new row in nested grid.....

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

Take a look at the attached sample.

Thanks,
Debata
 Download source file

Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 5/12/2011 [Member] [MVP] Starter | Points: 25

Login to post response