Gridview Using c#.net

Aug 14 2009 2:48 AM
Hello,
        I am implementing one aplication using c#.net.In that am using gridview containing checkbox and dropdownlist as template field.When i click on check box ,want to save selected value from dropdownlist to datatbase.But dropdown value is taking null.please help me anyone.
Here is my code:
for (int i = 0; i < gv_DisplayTasks.Rows.Count; i++)
            {
                GridViewRow row = gv_DisplayTasks.Rows[i];
                int rowindex = row.RowIndex;
                bool isChecked = ((CheckBox)row.FindControl("chk")).Checked;
                if (isChecked)
                {
                    sendforfeedbackbl = new tsk_SendForFeedBackBL();
                    sendforfeedback = new tsk_SendForFeeback();                
                    DropDownList ddl = (DropDownList)row.FindControl("ddl_rating");
                    string rating = ddl.SelectedItem.Value.ToString();
                 
                }
            }



Thanks
Soumya



Answers (2)