Hi,
this is shanker am doing application my requirement is catch the databound value in Itemdatabound event in GridEditable mode I am write this code
protected void fulldaygrid_ItemDataBound(object sender, GridItemEventArgs e)
{
int? student_absence_id = null;
if ((e.Item is GridEditableItem || e.Item is GridDataItem) && e.Item.IsInEditMode)
{
GridEditableItem editedItem = (GridEditableItem)e.Item;
int item = editedItem.ItemIndex - 1;
student_absence_id = editedItem.OwnerTableView.Items[item].Cells[1].ToString().GetInteger();
//int? eventId = GetEventId(e.Item);
if (student_absence_id.HasValue)
{
var det = studentattendancemanager.sch_view_student_absence_single_day_detail(student_absence_id);
//Label lblStudentname = e.Item.FindControl("lblStudentname") as Label;
//if (lblStudentname != null)
//{
// string Name = det.first_name + det.last_name;
// lblStudentname.Text = Name;
//}
//Label lblStudentNumber = e.Item.FindControl("lblStudentNumber") as Label;
//if (lblStudentNumber != null)
//{
// lblStudentNumber.Text = det.student_number;
//}
TextBox txtDescription = e.Item.FindControl("txtDescription") as TextBox;
if (txtDescription != null)
{
txtDescription.Text = det.description;
}
}
}
}
it's not working i am face this error
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
thanks and regards
shanker.B