private static void ConvertFromHyperLinkGridColumn(HyperLinkGridColumn current, GridColumn newColumn) { switch (newColumn.ColumnType) { case GridColumnType.BinaryImageGridColumn: ((BinaryImageGridColumn)newColumn).DataField = current.DataTextField; break; case GridColumnType.BoundGridColumn: ((BoundGridColumn)newColumn).DataField = current.DataTextField; ((BoundGridColumn)newColumn).DataFormatString = current.DataTextFormatString; break; case GridColumnType.DeleteGridColumn: ConvertToDeleteColumnDefaults(newColumn); break; case GridColumnType.EditGridColumn: ((EditGridColumn)newColumn).Text = current.Text; break; case GridColumnType.PickerHyperLinkGridColumn: break; case GridColumnType.PickerLinkButtonGridColumn: ((PickerLinkButtonGridColumn)newColumn).DataField = current.DataTextField; ((PickerLinkButtonGridColumn)newColumn).DataTextField = current.DataTextField; break; } }
public static GridColumn GetNewColumn(string type) { GridColumn retval = null; switch (type.ToLower()) { case "binaryimagegridcolumn": retval = new BinaryImageGridColumn(); break; case "boundgridcolumn": retval = new BoundGridColumn(); break; case "deletegridcolumn": retval = new DeleteGridColumn(); break; case "editgridcolumn": retval = new EditGridColumn(); break; case "hyperlinkgridcolumn": retval = new HyperLinkGridColumn(); break; case "pickerhyperlinkgridcolumn": retval = new PickerHyperLinkGridColumn(); break; case "pickerlinkbuttongridcolumn": retval = new PickerLinkButtonGridColumn(); break; } return(retval); }