您好,参考下面代码
- // Turn off automatic column and field mapping.
- fpSpread1.Sheets[0].AutoGenerateColumns = false;
- // Bind the component to the data set.
- fpSpread1.DataSource = dataSet1;
- // Set the fields for the columns.
- fpSpread1.Sheets[0].Columns[0].DataField = "Description";
- fpSpread1.Sheets[0].Columns[1].DataField = "ID";
- fpSpread1.Sheets[0].Columns[2].DataField = "LeadTime";
- fpSpread1.Sheets[0].Columns[3].DataField = "Price";
复制代码 |