不好意思,CCKan回答的也对,不过他是回答的MultiRow5.0以上版本的。在4.0中,如下:
代码如下,你需要使用CellNotify事件,这个事件的意思是当Cell在编辑状态是的一些行为会触发,比如,单击ButtonCell,或者在TextBoxCell里输入文字的时候,你可以通过e.Name来判断是什么样的事件类型,然后写你的逻辑,对于Button,对应的是Click。
- private void Form1_Load(object sender, EventArgs e)
- {
- this.multiRowSheet2.CellNotify += new GrapeCity.Win.ElTabelle.MCellNotifyEventHandler(multiRowSheet2_CellNotify);
- }
- void multiRowSheet2_CellNotify(object sender, GrapeCity.Win.ElTabelle.MCellNotifyEventArgs e)
- {
- if (e.Name == GrapeCity.Win.ElTabelle.CellNotifyEvents.Click)
- {
- //你可以在这里拿到e.Position,然后写你的逻辑
- }
- }
复制代码 |