Hi,
I'm still new to Telerik and having a hard time editing cell in the grid when selected the row.
below is my Linq .
var voters = (
from voter in db.VotersLists
.OrderBy(c => c.Barangay)
from data in db.VotersDatas
.Where(b => b.RecId == voter.ID)
.DefaultIfEmpty()
from leader in db.VotersLists
.Where(d => d.ID == data.LeaderID)
.DefaultIfEmpty()
select new
{
ID = voter.ID,
VotersID = voter.VotersID,
Precinct = voter.Precinct,
Name = voter.Name,
Birthday = voter.Birthday.GetValueOrDefault().ToShortDateString(),
Sex = voter.Sex,
Barangay = voter.Barangay,
Address = voter.Address,
PoliticalParty = data.PoliticalParty,
IsRD = data.IsRD,
LeaderName = leader.Name,
LeaderPosition = data.LeaderPosition
,DataID = data.ID.ToString() == null ? "" : data.ID.ToString()
});
dg2.DataSource = voters;
I tried using the code below and it won't work.
dg2.Rows[dg2.CurrentRow.Index].Cells[10].Value = "Test";
or
if (this.dg2.CurrentRow is GridViewRowInfo)
{
GridViewRowInfo editRow = dg2.CurrentRow;
editRow.Cells["LeaderName"].Value = "TEST";
}