public RenderContext GetRenderContextFor(BaseColumn column) { string columnName; if (string.IsNullOrEmpty(CrossColumnId)) { columnName = column.ColumnName; } else { var length = ColumnHierarchy.ColumnKey.Length - Column.ColumnName.Length - CrossColumnId.Length - 1; columnName = ColumnHierarchy.ColumnKey.Substring(0, length) + column.ColumnName + "_" + CrossColumnId; } if (!OtherColumns.ContainsKey(columnName)) { throw new ArgumentException("RenderContext does not contain column with name " + columnName); } return(OtherColumns[columnName]); }