| Author: Naresh 06 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
Hi
This is My code
if (index <dsQuestion.Tables[0].Rows.Count) { lblQuestion.Text = dsQuestion.Tables[0].Rows[index]["QuestionSequenceNumber"].ToString() + ":" + dsQuestion.Tables[0].Rows[index]["QuestionText"].ToString(); questionId = Convert.ToInt32(dsQuestion.Tables[0].Rows[index]["QuestionID"].ToString()); index += 1; CreateRadioButtons(questionId); button2.Enabled = true; } Previous() index -= 1; //label3.Text = "Index " + index.ToString(); if (index >= 0 && index < dsQuestion.Tables[0].Rows.Count) { btnMarks.Enabled = false; button2.Enabled = true; lblQuestion.Text = dsQuestion.Tables[0].Rows[index]["QuestionSequenceNumber"].ToString() + ":" + dsQuestion.Tables[0].Rows[index]["QuestionText"].ToString(); questionId = Convert.ToInt32(dsQuestion.Tables[0].Rows[index]["QuestionID"].ToString()); CreateRadioButtons(questionId); }
|
| Author: Kirtan 08 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
You need to Use CurrencyManager to Handle this type of issues Bind the DataTable With Currency Manager and All Texboxes you are using
then
Simply call cr.Position +=1
and cr.Position -=1 to Next Previous
Kirtan Patel ----------------------------------------------------- Master Of Computer Application(Sem-1) Bachelore of Computer Application
|