Hi,
I have having a grid where I use checkbox to edit the grid rows. On checkbox click how can I retain the dropdown values?
Anu suggestions?
Hi,
I have having a grid where I use checkbox to edit the grid rows. On checkbox click how can I retain the dropdown values?
Anu suggestions?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Feb 5, 2014, 8:11 PM EST
Vignesh KumarRank #1,579 · 1K reputationPosted Feb 5, 2014, 8:16 PM EST
protected void OnCheckedChanged(object sender, EventArgs e)
{
bool isUpdateVisible = false;
CheckBox chk = (sender as CheckBox);
if (chk.ID == "chkAll")
{
foreach (GridViewRow row in Updates.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
row.Cells[0].Controls.OfType
}
}
}
CheckBox chkAll = (Updates.HeaderRow.FindControl("chkAll") as CheckBox);
chkAll.Checked = true;
foreach (GridViewRow row in Updates.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
bool isChecked = row.Cells[0].Controls.OfType
for (int i = 1; i < row.Cells.Count; i++)
{
if (row.Cells[i].Controls.OfType
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Feb 5, 2014, 9:49 PM EST
Then actually you can remove AutoPostBack="true" from checkbox to avoid postback of the page.
Your value is getting lost because of the postback
Vignesh KumarRank #1,579 · 1K reputationPosted Feb 5, 2014, 11:12 PM EST
I tried it and I'm not able to edit the rows.
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Feb 6, 2014, 12:02 AM EST