Click here to Skip to main content
15,897,273 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: applying different styles to item and alternating item in datagrid Pin
Vipin.d8-Oct-07 20:22
Vipin.d8-Oct-07 20:22 
QuestionUpload file prompt for password Pin
J Liang8-Oct-07 19:32
J Liang8-Oct-07 19:32 
AnswerRe: Upload file prompt for password Pin
c#ivan8-Oct-07 21:33
c#ivan8-Oct-07 21:33 
GeneralRe: Upload file prompt for password Pin
J Liang9-Oct-07 15:32
J Liang9-Oct-07 15:32 
Questionhow to update detailsview Pin
puspendra napit8-Oct-07 19:21
puspendra napit8-Oct-07 19:21 
QuestionDynamically adding value in drop down list of a Gridview Pin
Ballita8-Oct-07 19:10
Ballita8-Oct-07 19:10 
AnswerRe: Dynamically adding value in drop down list of a Gridview Pin
pmarfleet8-Oct-07 21:30
pmarfleet8-Oct-07 21:30 
GeneralRe: Dynamically adding value in drop down list of a Gridview Pin
Ballita8-Oct-07 22:15
Ballita8-Oct-07 22:15 
Hi,
I am adding values to the ddl in RowDataBound event using the following code.

if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList ddlval = new DropDownList();
ddlval = (DropDownList)e.Row.FindControl("ddlvalidation");
if (lblcheck.Text == "Suspect")
{
ddlval.Items.Add("Error");
ddlval.Items.Add("No Error");
}
else if (lblcheck.Text == "Fatal")
{
ddlval.Items.Add("Not Fixed");
ddlval.Items.Add("Fixed");
}

& In the button save I am trying to fetch the selected values using the following code, but I am getting the error "Object reference not set to an instance of an object."

foreach (GridViewRow rec in this.gvsqldesc.Rows)
{

//Response.Write(rec.Cells[0].Text);
DropDownList ddlval = new DropDownList();
ddlval = (DropDownList)rec.FindControl("ddlvalidation");
string str = null;
str = ddlval.SelectedItem.Text;
}


Thanks & Regards
Mishra

GeneralRe: Dynamically adding value in drop down list of a Gridview Pin
pmarfleet8-Oct-07 22:47
pmarfleet8-Oct-07 22:47 
QuestionProject documentation [modified] Pin
scicorp8-Oct-07 19:09
scicorp8-Oct-07 19:09 
QuestionTreeview in asp.net Pin
Sam_IN8-Oct-07 18:54
Sam_IN8-Oct-07 18:54 
Questionexternal javascript in content page Pin
mmm!@#8-Oct-07 17:49
mmm!@#8-Oct-07 17:49 
AnswerRe: external javascript in content page Pin
c#ivan8-Oct-07 21:41
c#ivan8-Oct-07 21:41 
GeneralRe: external javascript in content page Pin
mmm!@#9-Oct-07 2:44
mmm!@#9-Oct-07 2:44 
QuestionPosting values to asp website from asp.net master page form [modified] Pin
Md Arif8-Oct-07 5:56
Md Arif8-Oct-07 5:56 
Questionget() set() methods Pin
66chawger8-Oct-07 5:26
66chawger8-Oct-07 5:26 
AnswerRe: get() set() methods Pin
Not Active8-Oct-07 7:25
mentorNot Active8-Oct-07 7:25 
QuestionPlease help me Urgent Pin
Suryanairg8-Oct-07 5:04
Suryanairg8-Oct-07 5:04 
AnswerRe: Please help me Urgent Pin
c#ivan8-Oct-07 5:06
c#ivan8-Oct-07 5:06 
GeneralRe: Please help me Urgent Pin
Suryanairg8-Oct-07 5:12
Suryanairg8-Oct-07 5:12 
AnswerRe: Please help me Urgent Pin
Scott Dorman8-Oct-07 8:46
professionalScott Dorman8-Oct-07 8:46 
AnswerRe: Please help me Urgent Pin
Christian Graus8-Oct-07 13:47
protectorChristian Graus8-Oct-07 13:47 
QuestionDisplay no image binary data Pin
c#ivan8-Oct-07 4:10
c#ivan8-Oct-07 4:10 
AnswerRe: Display no image binary data Pin
Pete O'Hanlon8-Oct-07 9:59
mvePete O'Hanlon8-Oct-07 9:59 
GeneralRe: Display no image binary data Pin
c#ivan8-Oct-07 11:00
c#ivan8-Oct-07 11:00 

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.