in my itemdatabound event handler, I want to populate an edited item dropdownlist based on the value of a grid dataitem, the reference to the dataitem (Points) fails like so:
if (e.Item is GridEditFormItem && e.Item.IsInEditMode) |
{ |
GridEditFormItem item = (GridEditFormItem)e.Item; |
GridEditableItem eeditedItem = e.Item as GridEditableItem; |
DropDownList list = item.FindControl("NumericGrade") as DropDownList; |
GridDataItem dataItem = e.Item as GridDataItem; |
String sPoints = dataitem["Points"].Text; |
int iPoints = Convert.ToInt16(sPoints); |
for (int j = 0; j < iPoints + 1; j++) |
{ |
list.Items.Add(j.ToString()); |
} |
I guess I could create a GridTemplateColumn for the Points field and then it would be accessible in GridEditFormItem(?) but I don't really want to through extra fields into the edit form?