ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2015-12-15 05:57:38

asparatu
Member
Registered: 2014-08-20
Posts: 196

how to programmatically fire the cellchangeddata event

Hello Jing,
    I would like to know i can programmatically enter a cell to fire the cellchangeddata event. do something like

call rgDataGatheringSheet_CellDataChanged(worksheet,A1)

from what i can see you send the current worksheet as the object but i do not know how to set the e variable.
Shane

Offline

#2 2015-12-15 06:23:54

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: how to programmatically fire the cellchangeddata event

Hi Shane,

You can't raise the event by programming. I am wondering why you want to do that.

If you want to do something when data changed, try change the code like:

void DoSomething(Cell cell) 
{
  ...
}

void rgDataGatheringSheet_CellDataChanged(object sender, CellEventArgs e)
{
  DoSomething(e.Cell);
}

and in anywhere you need call that function:

{
  DoSomething(rgDataGatheringSheet.Cells["A1"]);
}

or you just could call the event handler function:

rgDataGatheringSheet_CellDataChanged(worksheet, new CellEventArgs(myCell));

But this code doesn't make sense.

Last edited by Jingwood (2015-12-15 06:29:43)

Offline

#3 2015-12-15 07:50:26

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: how to programmatically fire the cellchangeddata event

Hello Jing,
   I have a code in a celldatachanged event that calculates and value base on input number and shows the different. The value is taken from textbox but it is not shown all the time, its based on the if they make a selection. so, if they change the textbox value it will not recalculated cell value. i wanted to go through all the data inputs and force to update the values. I had the code it was using posted before but delete the post because it was not specific in what i was asking.

What i need to do is call the event but didnt know how to pass the cell to celleventarg

Shane

Last edited by asparatu (2015-12-15 07:52:47)

Offline

Board footer

Powered by FluxBB