I have a RadGridView with GridViewCheckboxColumn.
When I click on any cell in the grid I catch the CellClick event of the grid and check/uncheck the checkboxcolumn in the specific current row.
It work fine in all the cells except for click on the checkbox cell that do change the value but the result doesn’t appear in the checkbox.
The changes are seen only after I move the cursor.
How it is possible that the value is changed but the checkbox isn’t checked/ unchecked ?
void RadGridView_CellClick(object sender, GridViewCellEventArgs e)
{
if (e.RowIndex > -1)
{
if (e.Row.Cells["Sel"] != null)
{
if (e.Row.Cells["Sel"].Value != DBNull.Value)
e.Row.Cells["Sel"].Value = !Convert.ToBoolean(e.Row.Cells["Sel"].Value);
else
e.Row.Cells["Sel"].Value = true;
}
}
}
private void radPnTextBox_TextChanged(object sender, EventArgs e)
{
//populate autocomplete list
if (VDO != null)
{
//fetch updated list from database
PnDropdownList = VDO.GetAutoCompletePnDescription(radPnTextBox.Text.ToUpper());
//re-bind the this list by re-assigning the datasource
radPnTextBox.AutoCompleteDataSource = PnDropdownList;
}
}
01.
var g = db.tbl_wat_Affiliate_Commission.Join(db.tbl_wat_Affiliate, ac => ac.IdAffiliateUser, a => a.AffiliateUser, (ac, a) =>
new
{ ac, a });
02.
this
.radGridView1.DataSource = db.tbl_wat_Affiliate_Commission.Local.ToBindingList();
03.
this
.radGridView1.AllowAddNewRow =
true
;
04.
this
.radGridView1.AllowEditRow =
true
;
05.
this
.radGridView1.AllowDeleteRow =
true
;
06.
07.
// Create and load child
08.
09.
db.tbl_sst_ItemAffiliate.Load();
10.
11.
GridViewTemplate template =
new
GridViewTemplate();
12.
template.DataSource = db.tbl_sst_ItemAffiliate.Local.ToBindingList();
13.
// Hinzufügen des childtemps.//
14.
this
.radGridView1.MasterTemplate.Templates.Add(template);
15.
16.
//Create relation//
17.
GridViewRelation relation =
new
GridViewRelation(
this
.radGridView1.MasterTemplate);
18.
relation.ChildTemplate = template;
19.
relation.RelationName =
"Affiliate"
;
20.
relation.ParentColumnNames.Add(
"IdAffiliateUser"
);
21.
relation.ChildColumnNames.Add(
"IdAffiliateUser"
);
22.
this
.radGridView1.Relations.Add(relation);