回复 1楼iceman的帖子
无内置的方法。
可通过如下办法:遍历row、column,对比内容实现
- public bool FindRowColumnIndexByContext(string content, ref int rowIndex, ref int ColumnIndex)
- {
- for (int i = 0; i < gcSpreadSheet1.ActiveSheet.RowCount; i++)
- {
- for (int j = 0; j < gcSpreadSheet1.ActiveSheet.ColumnCount; j++)
- {
- if (string.Compare(gcSpreadSheet1.ActiveSheet.Cells[i, j].Text, content) == 0)
- {
- rowIndex = i;
- ColumnIndex = j;
- return true;
- }
- }
- }
- return false;
- }
复制代码 |