Default Cell Border lines

Posted by: Luis.Alvarez on 5 July 2018, 9:19 am EST

    • Post Options:
    • Link

    Posted 5 July 2018, 9:19 am EST

    Hi,

    I’m using a cellChange event handler to perform some logic whenever the user changes the value of a cell. Part of this logic determines if additional rows are needed and adds them. All the cells need a border line. I noticed that when additional rows are added by the logic (increasing the rowcount) the new rows/cells do not have border lines. I added logic to set the border lines around the new rows within the handler. Setting the border lines within the event handler causes the cellChange event to be invoked again and places the application into an endless loop. Is there a way to set a default style so that when new rows are added they will inherit the border lines style and not call the cellChange event handler?

    Thanks,

    Luis

  • Posted 5 July 2018, 5:37 pm EST

    Hi Luis,

    You can use the CellValueApplying event instead of the CellChanged event to perform the logic operation. Setting the border will not cause this event to fire. Something like:

       private void GcSpreadSheet1_CellValueApplying(object sender, GrapeCity.Windows.SpreadSheet.UI.CellValueApplyingEventArgs e)
            {
                //throw new NotImplementedException();
               
                if (e.Row == gcSpreadSheet1.ActiveSheet.RowCount - 1)
                {
                  // perform your logic here
                }
            }
    

    Thanks,

    Deepak Sharma

  • Posted 5 July 2018, 6:20 pm EST

    Hello,

    Further to add this , you can also go for EditEnd/EditChange/ValueChange events of Spread instance to write your logic.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels