Link to home
Start Free TrialLog in
Avatar of Ron Renninger
Ron Renninger

asked on

Use an array to change value in gridview

I have an array:
public static readonly string[] OrderStatuses =
       {"Order Placed", // 0
        "Check funds", // 1
        "Waiting for Order Approval", // 2
        "Waiting to Print Label", // 3
        "Waiting to Print Packing Slip", //4
        "Waiting to Charge Credit Card", //5
        "Waiting to Send email", // 6
        "Waiting Completed", // 7
        "Order Completed" }; // 8


The code for the dataGrid I want to take the status value and change in the gridview to the string of orderstatus. So if the status is 0 show Order Placed instead on 0

            Report = commercelLibAccess.GetOrdersByRecent(Count);
            DataSet Output = new DataSet();
            Grid.AutoGenerateColumns = false;

            Grid.ColumnCount = 5;

            Grid.Columns[0].Name = "OrderId";
            Grid.Columns[0].HeaderText = "Order Id";
            Grid.Columns[0].DataPropertyName = "OrderId";

            Grid.Columns[1].Name = "DateCreated";
            Grid.Columns[1].HeaderText = "Date Created";
            Grid.Columns[1].DataPropertyName = "DateCreated";

            Grid.Columns[2].Name = "DateShipped";
            Grid.Columns[2].HeaderText = "Date Shipped/ Pickup";
            Grid.Columns[2].DataPropertyName = "DateShipped";

            Grid.Columns[3].Name = "Status";
            Grid.Columns[3].HeaderText = "Status";
            Grid.Columns[3].DataPropertyName = "Status";
           

            Grid.Columns[4].Name = "StorePickup";
            Grid.Columns[4].HeaderText = "Store Pickup";
            Grid.Columns[4].DataPropertyName = "Store Pickup";
           

            Grid.DataSource = Report.Tables["table"];
ASKER CERTIFIED SOLUTION
Avatar of Dirk Strauss
Dirk Strauss
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial