1. Editable template Field to be bounded correctly. This is not binding my value
2. When I check multiple checkboxes only odd numbered rows are enabled.
3. on clicking update button I should copy the checked rows to a datatable and pass this to data access layer
Please find the code below
.ascx
.cs file
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid3();
}
{
BindGrid3();
}
private void BindGrid3()
{
DataSet dsErrorRecords = new DataSet();
Return returnEntity = GetErrorDetails.Get(objCurrentUser.Country, objCurrentUser.Division, txtFromDate.Text, txtToDate.Text,ddlErrorDescription.SelectedValue);
dsErrorRecords = returnEntity.ResultSet;
if(dsErrorRecords != null)
GVErrorRecords.DataSource = dsErrorRecords.Tables[0];
GVErrorRecords.DataBind();
}
{
DataSet dsErrorRecords = new DataSet();
Return returnEntity = GetErrorDetails.Get(objCurrentUser.Country, objCurrentUser.Division, txtFromDate.Text, txtToDate.Text,ddlErrorDescription.SelectedValue);
dsErrorRecords = returnEntity.ResultSet;
if(dsErrorRecords != null)
GVErrorRecords.DataSource = dsErrorRecords.Tables[0];
GVErrorRecords.DataBind();
}
protected void OnCheckedChanged(object sender, EventArgs e)
{
bool isUpdateVisible = false;
foreach (GridViewRow row in GVErrorRecords.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
bool isChecked = row.Cells[0].Controls.OfType
for (int i = 1; i < row.Cells.Count; i++)
{
// row.Cells[i].Controls.OfType
protected void Update(object sender, EventArgs e)
{
foreach (GridViewRow row in GVErrorRecords.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
bool isChecked = row.Cells[0].Controls.OfType().FirstOrDefault().Checked;
if (isChecked)
{
}
}
}
btnUpdate.Visible = false;
this.BindGrid3();
}
{
foreach (GridViewRow row in GVErrorRecords.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
bool isChecked = row.Cells[0].Controls.OfType
if (isChecked)
{
}
}
}
btnUpdate.Visible = false;
this.BindGrid3();
}
Emi WhoPosted May 26, 2021, 5:26 PM
Yogesh GhorpadePosted Jun 26, 2018, 7:28 AM