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.GetOrde rsByRecent (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].DataProper tyName = "OrderId";
Grid.Columns[1].Name = "DateCreated";
Grid.Columns[1].HeaderText = "Date Created";
Grid.Columns[1].DataProper tyName = "DateCreated";
Grid.Columns[2].Name = "DateShipped";
Grid.Columns[2].HeaderText = "Date Shipped/ Pickup";
Grid.Columns[2].DataProper tyName = "DateShipped";
Grid.Columns[3].Name = "Status";
Grid.Columns[3].HeaderText = "Status";
Grid.Columns[3].DataProper tyName = "Status";
Grid.Columns[4].Name = "StorePickup";
Grid.Columns[4].HeaderText = "Store Pickup";
Grid.Columns[4].DataProper tyName = "Store Pickup";
Grid.DataSource = Report.Tables["table"];
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.GetOrde
DataSet Output = new DataSet();
Grid.AutoGenerateColumns = false;
Grid.ColumnCount = 5;
Grid.Columns[0].Name = "OrderId";
Grid.Columns[0].HeaderText
Grid.Columns[0].DataProper
Grid.Columns[1].Name = "DateCreated";
Grid.Columns[1].HeaderText
Grid.Columns[1].DataProper
Grid.Columns[2].Name = "DateShipped";
Grid.Columns[2].HeaderText
Grid.Columns[2].DataProper
Grid.Columns[3].Name = "Status";
Grid.Columns[3].HeaderText
Grid.Columns[3].DataProper
Grid.Columns[4].Name = "StorePickup";
Grid.Columns[4].HeaderText
Grid.Columns[4].DataProper
Grid.DataSource = Report.Tables["table"];
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.