myGrid.Columns.Add(new BoundColumn { HeaderText = "Category", DataField = "ProductCategory" });
myGrid.Columns.Add(new BoundColumn { DataField = "OrderDate", DataFormatString = "{0:d}" });
myGrid.Columns.Add(new TemplateColumn { HeaderText = "Total Price", ItemTemplate = new TotalPriceColumn() });In this example, we're adding a new column to the "myGrid" control that shows the total price of an order. We've defined a custom data type (TotalPriceColumn) and assigned it to the ItemTemplate property of the column. Overall, Grid AddColumn is a useful method for customizing grid controls in C#. You can use it to add new columns, customize their headers and formats, and even define custom data types.