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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Biswa Pujarini MohapatraPosted Feb 6, 2014, 5:02 AM
Vignesh KumarPosted Feb 6, 2014, 4:12 AM
I tried it and I'm not able to edit the rows.
Biswa Pujarini MohapatraPosted Feb 6, 2014, 2:49 AM
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 KumarPosted Feb 6, 2014, 1:16 AM
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
Sanjeeb LenkaPosted Feb 6, 2014, 1:11 AM