回复 1楼usst的帖子
如果是默认列名则通过以下方法:
- string label = this.FpSpread1.ActiveSheetView.Columns[0].Label;
复制代码
如果是非默认列标:
- protected void Page_Load(object sender, EventArgs e)
- {
- this.FpSpread1.ActiveSheetView.ActiveColumn = 0;
- int activeCol=this.FpSpread1.ActiveSheetView.ActiveColumn+65;
- string colLable = NunToChar(activeCol);
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- }
- ///
- /// 数字转字母
- ///
- /// 要转换成字母的数字(数字范围在闭区间[65,90])
- ///
- private string NunToChar(int number)
- {
- if (65 <= number && 90 >= number)
- {
- System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
- byte[] btNumber = new byte[] { (byte)number };
- return asciiEncoding.GetString(btNumber);
- }
- return "数字不在转换范围内";
- }
复制代码 |