Click here to Skip to main content
15,887,267 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Using CKeditor (fck) with ASP.NET Pin
R. Giskard Reventlov17-Jul-12 5:35
R. Giskard Reventlov17-Jul-12 5:35 
GeneralRe: Using CKeditor (fck) with ASP.NET Pin
murad_3517-Jul-12 5:46
murad_3517-Jul-12 5:46 
GeneralRe: Using CKeditor (fck) with ASP.NET Pin
jkirkerx17-Jul-12 6:59
professionaljkirkerx17-Jul-12 6:59 
GeneralRe: Using CKeditor (fck) with ASP.NET Pin
murad_3517-Jul-12 11:51
murad_3517-Jul-12 11:51 
Generalaspx pages are webforms Pin
jkirkerx17-Jul-12 12:53
professionaljkirkerx17-Jul-12 12:53 
Generalasp.net using iis express Pin
dcof17-Jul-12 4:00
dcof17-Jul-12 4:00 
GeneralRe: asp.net using iis express Pin
R. Giskard Reventlov17-Jul-12 5:41
R. Giskard Reventlov17-Jul-12 5:41 
Questioncheckbox select particular row from gridview1 Pin
siddiqui_198517-Jul-12 0:57
siddiqui_198517-Jul-12 0:57 
Hi everyone!
As title said it all anyway I have a table is sql server “products”
Prod_id Prod_name Price Category
1 Abc 100 Books
2 Xyz 50 books
3 TV 1200 Electronics

And many more
I can select category wise in gridview1 and there is a “Template checkbox“ in each row of gridview1
There is a button and another empty gridview2 .
What I want is when i checked the checkbox in a row by clicking select button it should display in an empty gridview2 . it works fine but when I checked another row the previously added row in gridview2 override with it, and 2nd gridview get only one from 1st gridview1.
What I actually want is when i checked multiple rows it should display the data of these particular selected rows in 2nd gridview.

Here is my code ::

C#
protected void Button1_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {

            CheckBox chbox = GridView1.Rows[i].Cells[0].FindControl("CheckBox1") as CheckBox;

            if (chbox.Checked == true)
            {
                string conn = ConfigurationManager.ConnectionStrings["Test_T3ConnectionString2"].ConnectionString;
                SqlConnection con = new SqlConnection(conn);
                string query = "select prod_name,price from products where prod_id = '" + GridView1.Rows[i].Cells[1].Text + "'";
                SqlCommand cmd = new SqlCommand(query, con);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable dt = new DataTable();
                da.Fill(dt);

                GridView2.DataSource = dt;
                GridView2.DataBind();
            }

        }
    }


Sorry about my English Smile | :) and please help..
Thanks
AnswerRe: checkbox select particular row from gridview1 Pin
Dhyanga17-Jul-12 10:26
Dhyanga17-Jul-12 10:26 
Questionhow to use adodc in vb.net Pin
prafulvdangre16-Jul-12 23:29
prafulvdangre16-Jul-12 23:29 
AnswerRe: how to use adodc in vb.net Pin
Richard MacCutchan16-Jul-12 23:41
mveRichard MacCutchan16-Jul-12 23:41 
QuestionSearch is slow if large data in Gridview Pin
sumB16-Jul-12 22:03
sumB16-Jul-12 22:03 
AnswerRe: Search is slow if large data in Gridview Pin
Sandeep Mewara16-Jul-12 23:28
mveSandeep Mewara16-Jul-12 23:28 
GeneralRe: Search is slow if large data in Gridview Pin
sumB16-Jul-12 23:55
sumB16-Jul-12 23:55 
GeneralRe: Search is slow if large data in Gridview Pin
Sandeep Mewara17-Jul-12 0:06
mveSandeep Mewara17-Jul-12 0:06 
GeneralRe: Search is slow if large data in Gridview Pin
sumB17-Jul-12 0:27
sumB17-Jul-12 0:27 
AnswerRe: Search is slow if large data in Gridview Pin
Sandeep Mewara17-Jul-12 0:30
mveSandeep Mewara17-Jul-12 0:30 
GeneralRe: Search is slow if large data in Gridview Pin
sumB17-Jul-12 2:21
sumB17-Jul-12 2:21 
GeneralRe: Search is slow if large data in Gridview Pin
meeram39518-Jul-12 0:48
meeram39518-Jul-12 0:48 
GeneralRe: Search is slow if large data in Gridview Pin
ashjassi17-Aug-12 2:59
ashjassi17-Aug-12 2:59 
Questionupload MS Word to MySQL Pin
Jassim Rahma16-Jul-12 7:46
Jassim Rahma16-Jul-12 7:46 
AnswerRe: upload MS Word to MySQL Pin
Sandeep Mewara16-Jul-12 21:07
mveSandeep Mewara16-Jul-12 21:07 
QuestionSession time out not working Pin
Member 910478815-Jul-12 23:00
Member 910478815-Jul-12 23:00 
AnswerRe: Session time out not working Pin
Karthik Harve15-Jul-12 23:09
professionalKarthik Harve15-Jul-12 23:09 
AnswerRe: Session time out not working Pin
Rahul Rajat Singh16-Jul-12 2:18
professionalRahul Rajat Singh16-Jul-12 2:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.