Click here to Skip to main content
13,092,862 members (97,713 online)
Rate this:
Please Sign up or sign in to vote.
See more:
string frm = ((DropDownList)gv_rap.Rows[i].Cells[12].FindControl("ddlfrm")).Text.Trim();
                   string to = ((DropDownList)gv_rap.Rows[i].Cells[13].FindControl("ddlto")).Text.Trim();

above code display record.

but textbox doesn't show value in textbox when click on add button griedview
string frm = ((Textbox)gv_rap.Rows[i].Cells[12].FindControl("ddlfrm")).Text.Trim();
                   string to = ((Textbox)gv_rap.Rows[i].Cells[13].FindControl("ddlto")).Text.Trim();
Posted 20-Apr-13 3:30am
Sandeep Mewara 20-Apr-13 11:00am
Are there dropdown and textbox (2 controls) in Cell[12] ? If not then why are you casting that cell control?
anghan22 21-Apr-13 3:09am
i have use textbox cells[12] but doesn't display value when click on imahe button on gried view
anghan22 21-Apr-13 3:12am
if (e.CommandName == "select")

for (int i = 0; i < gv_rap.Rows.Count; i++)
var color = ((Label)gv_rap.Rows[i].Cells[3].FindControl("lblcolor")).Text.Trim(); //If its label
var cl = ((Label)gv_rap.Rows[i].Cells[4].FindControl("lblclearity")).Text.Trim();
var shape = ((Label)gv_rap.Rows[i].Cells[7].FindControl("lblshape")).Text.Trim();
string frm = ((DropDownList)gv_rap.Rows[i].Cells[12].FindControl("ddlfrm")).Text.Trim();
string to = ((DropDownList)gv_rap.Rows[i].Cells[13].FindControl("ddlto")).Text.Trim();

TextBox txtrap = ((TextBox)gv_rap.Rows[i].Cells[14].FindControl("txtrap"));
string str = "select rap from test where frm='" + frm+ "'and tom='" + to + "'and round='" + shape + "'and clearity='" + cl + "'and color= '" + color + "'";
SqlCommand cmd = new SqlCommand(str, conn);
SqlDataReader reader = cmd.ExecuteReader();

if (reader.Read())

txtrap.Text= reader["rap"].ToString();



anghan22 21-Apr-13 3:15am
above my code when click onsingle time select image button at that time all row in griedview
change value in txtrap field griedview textbox...

i have to one by one get value in txtrap taxtbox...

please help..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100