lud 你好,
使用后台代码可以使用 SpreadView 下 Search() 方法,其中参数 ref row 、ref col 保存搜索结果的行列索引,参考代码:- private void Form1_Load(object sender, EventArgs e)
- {
- int row = 0;
- int col = 0;
- this.fpSpread1.Sheets[0].ColumnCount = 10;
- this.fpSpread1.Sheets[0].RowCount = 11;
- for (int i = 0; i < 10; i++)
- {
- for (int j = 0; j < 10; j++)
- {
- this.fpSpread1.Sheets[0].Cells[i, j].Text = "1";
- }
- }
- this.fpSpread1.Sheets[0].Cells[9, 9].Text = "test";
- this.fpSpread1.Search(0, "test", false, false, false, false, 0, 0, 9, 9,ref row,ref col);
- int rowindex = row;
- }
复制代码 |