Click here to Skip to main content
15,896,359 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how i can get the values of the grid view into textboxes Pin
varshavmane11-Nov-07 18:34
varshavmane11-Nov-07 18:34 
GeneralRe: how i can get the values of the grid view into textboxes Pin
jagan12311-Nov-07 19:26
jagan12311-Nov-07 19:26 
GeneralRe: how i can get the values of the grid view into textboxes Pin
varshavmane11-Nov-07 19:37
varshavmane11-Nov-07 19:37 
GeneralRe: how i can get the values of the grid view into textboxes Pin
jagan12311-Nov-07 20:00
jagan12311-Nov-07 20:00 
GeneralRe: how i can get the values of the grid view into textboxes Pin
varshavmane11-Nov-07 20:13
varshavmane11-Nov-07 20:13 
GeneralRe: how i can get the values of the grid view into textboxes Pin
jagan12311-Nov-07 20:20
jagan12311-Nov-07 20:20 
GeneralRe: how i can get the values of the grid view into textboxes Pin
varshavmane11-Nov-07 20:23
varshavmane11-Nov-07 20:23 
GeneralRe: how i can get the values of the grid view into textboxes Pin
jagan12311-Nov-07 20:41
jagan12311-Nov-07 20:41 
public partial class _Default : System.Web.UI.Page
{
DataTable dt ;
DataColumn dcindex;
DataColumn dcname;
DataRow dr;

protected void Page_Load(object sender, EventArgs e)
{

txtname.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btngetdata.UniqueID + "').click();return false;}} else {return true}; ");

if (IsPostBack == false)
{
for (int i = 0; i < 4; i++)
{
ddl.Items.Add("index" + (i + 1));
}
ddl.SelectedIndex = 1;
}
txtname.Focus();
txtname.Focus();
Panel2.Visible = false;

}
protected void message1(string msg)
{
Label lbl = new Label();
lbl.Text = "window.alert('" + msg + "')";
Page.Controls.Add(lbl);
}

protected void btngetdata_Click(object sender, EventArgs e)
{

try
{
Panel2.Visible = true;
txtname.Focus();
if (ddl.SelectedIndex >= 4)
ddl.SelectedIndex = 4;
if ((ViewState["datatable"]) == null)
{
dt = new DataTable();
dcindex = new DataColumn("index", typeof(string));
dcname = new DataColumn("name", typeof(string));
dt.Columns.Add(dcindex);
dt.Columns.Add(dcname);

}
else

dt = (DataTable)ViewState["datatable"];
dr = dt.NewRow();
if (ddl.SelectedIndex == 0 || txtname.Text == "")
{
message1("Either u have not selected index value nor NameField is empty");
}
else
{
dr["index"] = ddl.SelectedItem.ToString();
dr["name"] = txtname.Text;
dt.Rows.Add(dr);
gv.DataSource = dt;
gv.DataBind();
txtname.Text = "";
ViewState["datatable"] = dt;
if (ddl.SelectedIndex < 4)
ddl.SelectedIndex = ddl.SelectedIndex + 1;
else
{
ddl.SelectedIndex = 1;
}
}
}
catch (Exception ee)
{
Response.Write(ee.Message);
}

}


protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
{
Panel2.Visible = true;
txtname.Focus();
if(txtname.Text !="")
Panel2.Visible = true;
}
i kept one drop downlist and text box whern ever i select index and write name in the textbox it should get in the grideview and when ever i select some row in the grid view it should get in the drop down list and textbox
GeneralRe: how i can get the values of the grid view into textboxes Pin
varshavmane11-Nov-07 21:12
varshavmane11-Nov-07 21:12 
QuestionSession Scope Pin
Expert Coming11-Nov-07 18:16
Expert Coming11-Nov-07 18:16 
AnswerRe: Session Scope Pin
John-ph11-Nov-07 18:48
John-ph11-Nov-07 18:48 
GeneralRe: Session Scope Pin
Expert Coming12-Nov-07 13:57
Expert Coming12-Nov-07 13:57 
AnswerRe: Session Scope Pin
Michael Sync11-Nov-07 18:51
Michael Sync11-Nov-07 18:51 
GeneralButton click from cache Pin
Shajeel11-Nov-07 17:55
Shajeel11-Nov-07 17:55 
GeneralRe: Button click from cache Pin
Michael Sync11-Nov-07 18:46
Michael Sync11-Nov-07 18:46 
GeneralRe: Button click from cache Pin
John-ph11-Nov-07 18:57
John-ph11-Nov-07 18:57 
GeneralRe: Button click from cache Pin
Shajeel11-Nov-07 19:48
Shajeel11-Nov-07 19:48 
Questionsolution(.sln) file problem Pin
yesu prakash11-Nov-07 17:06
yesu prakash11-Nov-07 17:06 
AnswerRe: solution(.sln) file problem Pin
Michael Sync11-Nov-07 18:43
Michael Sync11-Nov-07 18:43 
QuestionHow to save the last changes you have made with your page Pin
monafr8111-Nov-07 15:54
monafr8111-Nov-07 15:54 
AnswerRe: How to save the last changes you have made with your page Pin
Christian Graus11-Nov-07 15:56
protectorChristian Graus11-Nov-07 15:56 
GeneralRe: How to save the last changes you have made with your page Pin
monafr8112-Nov-07 1:20
monafr8112-Nov-07 1:20 
QuestionMaster Pages, is the entire concept misleading? Pin
nowensone11-Nov-07 12:40
nowensone11-Nov-07 12:40 
AnswerRe: Master Pages, is the entire concept misleading? Pin
Christian Graus11-Nov-07 12:48
protectorChristian Graus11-Nov-07 12:48 
GeneralRe: Master Pages, is the entire concept misleading? Pin
nowensone11-Nov-07 13:21
nowensone11-Nov-07 13:21 

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.