CancelControlID="btnCloseGRP" BackgroundCssClass="modalBackground">
OnRowDataBound="GridViewGrp_RowDataBound" OnSelectedIndexChanged="GridViewGrp_SelectedIndexChanged"
ForeColor="#333333" GridLines="None" Width="100%" AllowPaging="True" OnPageIndexChanging="GridViewGrp_PageIndexChanging" PageSize="3"
EnableSortingAndPagingCallbacks = "true">
This is my gridview in popup window.. When I search for a record, popup window disappears but it is working. So I want to make popup still there when I click on search button.
Anyone please suugest me an answer,
Thank U..:)
12 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjeeb LenkaPosted Aug 31, 2013, 7:17 AM
put this line of code within your search button click event:
mp1.Show();
shibasankar beheraPosted Aug 31, 2013, 8:26 AM
SqlCommand cmdPopGRP = new SqlCommand("select * from Group_Master", con);
cmdPopGRP.CommandType = CommandType.Text;
SqlDataAdapter daGRP = new SqlDataAdapter(cmdPopGRP);
DataSet dsGRP = new DataSet();
daGRP.Fill(dsGRP, "ssGrp");
GridViewGrp.DataSource = dsGRP.Tables["ssGrp"];
GridViewGrp.DataBind();
when I click on any row of gridview, the group name value will be set to dropdown(Item_GrpDropName).. below is the code..
protected void GridViewGrp_SelectedIndexChanged(object sender, EventArgs e)
{
if (GridViewGrp.SelectedIndex != -1)
{
GridViewRow row = GridViewGrp.SelectedRow;
Item_GrpDropName.SelectedValue = Item_GrpDropName.Items.FindByText(row.Cells[2].Text).Value;
}
}
this is for search-----
protected void btnGrpSrch_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection(" ");//connection name
con.Open();
string query = "select * from Group_Master where ((GrpMst_ID like'" + TextBoxGrpSrch.Text + "%') or(GrpMst_Name like'" + TextBoxGrpSrch.Text + "%'))";
SqlDataAdapter da = new SqlDataAdapter(query, con);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
GridViewGrp.DataSource = ds;
GridViewGrp.DataBind();
mp1.Show();
}
else
{
Response.Write(@"");
}
}
catch (Exception ex)
{
Response.Write(ex);
}
}
My gridview is in the popup window...
Sanjeeb LenkaPosted Aug 31, 2013, 8:21 AM
plz provide your code where you assign cricket to parent page..
shibasankar beheraPosted Aug 31, 2013, 8:18 AM
But bydefault It is taking the 1st row value i.e book...
Sanjeeb LenkaPosted Aug 31, 2013, 8:14 AM
from your screen shot. you want show the value of cricket in which textbox on selection.
Are you want to update the value of cricket.
shibasankar beheraPosted Aug 31, 2013, 8:06 AM
Thank u
Sanjeeb LenkaPosted Aug 31, 2013, 7:58 AM
plz check there is no attachment in your post.
shibasankar beheraPosted Aug 31, 2013, 7:51 AM
I think its happening coz book is in the 1st row in gridview.
plz see the attached file..
Sanjeeb LenkaPosted Aug 31, 2013, 7:39 AM
i didn't get your point plz provide clear details.
shibasankar beheraPosted Aug 31, 2013, 7:36 AM
Another thing, suppose I enter one record and It shows 7th row value in gridview.
But when I click on that searched result, by default it is taking 1st row value of gridview and displaying in textbox. How I can get that result value to the textbox??
Sanjeeb LenkaPosted Aug 31, 2013, 7:29 AM
you are welcome.
happy coding........
shibasankar beheraPosted Aug 31, 2013, 7:24 AM