Issue when using a spread inside a cell of another spread

Posted by: eager2knw on 8 September 2017, 1:37 pm EST

  • Posted 8 September 2017, 1:37 pm EST

    Hi,


    I have a parent spread fpspread1 which has a child spread fpspread2

    <FONT size=2>

    fpspread2 = ((</FONT><FONT color=#2b91af size=2>FpSpreadCellType</FONT><FONT size=2>)(fpspread1 .ActiveSheet.Cells[rowIndex, colIndex</FONT><FONT size=2>].CellType)).cellTypeSpread;</FONT>


    The code for customcelltype is as follows :

    <FONT size=2><FONT size=2>

    </FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>class</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>FpSpreadCellType</FONT><FONT size=2> : FarPoint.Win.Spread.CellType.</FONT><FONT color=#2b91af size=2>EditBaseCellType

    </FONT><FONT size=2>

    {


    </FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2>FpSpread</FONT><FONT size=2> cellTypeSpread;


    </FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> PaintCell(System.Drawing.</FONT><FONT color=#2b91af size=2>Graphics</FONT><FONT size=2> g, System.Drawing.</FONT><FONT color=#2b91af size=2>Rectangle</FONT><FONT size=2> r,


    FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2>Appearance</FONT><FONT size=2> appearance, </FONT><FONT color=#0000ff size=2>object</FONT><FONT size=2> value,


    </FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> isSelected, </FONT><FONT color=#0000ff size=2>bool</FONT><FONT size=2> isLocked, </FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2> zoomFactor)


    {


    </FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (cellTypeSpread.Visible == </FONT><FONT color=#0000ff size=2>false</FONT><FONT size=2>)


    {


    cellTypeSpread.Visible = </FONT><FONT color=#0000ff size=2>true</FONT><FONT size=2>;


    }


    cellTypeSpread.Size = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>Size</FONT><FONT size=2>(r.Width, r.Height);


    cellTypeSpread.Location = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>Point</FONT><FONT size=2>(r.X, r.Y);


    }


    </FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> FpSpreadCellType(FarPoint.Win.Spread.</FONT><FONT color=#2b91af size=2>FpSpread</FONT><FONT size=2> spread)


    {


    cellTypeSpread = spread;


    }


    }


    </FONT> Now I manipulate with the child spread (fpspread2) <FONT size=2>


    fpspread2.ActiveSheet.Columns[0].BackColor = System.Drawing.</FONT><FONT color=#2b91af size=2>Color</FONT><FONT size=2>.Red;

    </FONT>

    But the changes are not reflected <img src="/emoticons/emotion-6.gif" alt="Sad" />


    Where could I have gone wrong?


    Thanks,


    Eager2knw</FONT><FONT size=2>

    </FONT>
  • Replied 8 September 2017, 1:37 pm EST

    Are you assigning this custom celltype to the parent spread or do you have two spreads on a form?  Do you have a small project you could attach showing this behavior?
  • Replied 8 September 2017, 1:37 pm EST

    Hi,


    Im using custom celltype to the parent spread


    <FONT size=2>fpSpread2 = ((</FONT><FONT color=#2b91af size=2>FpSpreadCellType</FONT><FONT size=2>)(fpSpread1.ActiveSheet.Cells


    [rowIndex, colIndex</FONT><FONT size=2>].CellType)).cellTypeSpread . </FONT>

    <FONT size=2><FONT size=2>

    fpSpread2 .ActiveSheet.Columns[0].BackColor = System.Drawing.</FONT><FONT color=#2b91af size=2>Color</FONT><FONT size=2>.Red;

    </FONT></FONT>

    <FONT size=2>Now, the changes that I apply to the spread are not reflected.</FONT>


    <FONT size=2>Thanks,</FONT>


    Eager2knw


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2></FONT> 


    <FONT size=2> 

    </FONT>
  • Replied 8 September 2017, 1:37 pm EST

    Do you have a small project you could attach showing this behavior?
Need extra support?

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

Learn More

Forum Channels