Hey everyone, I have a gridbuttoncolumn at the top level of a 3 level hierarchical grid and I am trying to modify the cells of this column in the ItemCreated event for the grid. It works fine on initial load but then when a column is expanded it loses the changes. If there is a better way of doing this please let me know but really I just wan't the link to display if a condition is true that I am checking in the ItemCreated event. The code for the event is below.
| protected void grdVariableLst_ItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item.OwnerTableView.Name == "Variables") |
| { |
| if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) |
| { |
| GridDataItem item; |
| item = (GridDataItem)e.Item; |
| if (int.Parse(((System.Data.DataRowView)(e.Item.DataItem)).Row.ItemArray[4].ToString()) == 1) |
| { |
| item["DeleteColumn"].Text = "Delete"; |
| } |
| } |
| } |
| } |