Cell Types

Posted by: john-shugart on 8 September 2017, 2:05 pm EST

  • Posted 8 September 2017, 2:05 pm EST

    <P>I have a spread that has a datasource of a RowFilter, when I change the datasouce it appears as though the cell type is being reset. I say this because my comma's dissapear when I change the RowFilter.</P>
    <P>I've set a breakpoint and the cell type is still intact, but the ShowSeparator isn't showing. How can I maintain the separators when changing the RowFilter?</P>
    <P>Thanks in advance,</P>
    <P>John</P>
  • Replied 8 September 2017, 2:05 pm EST

    <P>Hello,</P>
    <P>My experience has been that changing things pertaining to the DataSource tend to reset CellTypes. As a work-around, this is what I do:</P>
    <P>VB.Net</P>
    <P>' In form load code or other initialization code.<BR>Dim list As Dictionary(Of Integer, ICellType)<BR>For Each column As Column In Me.FpSpread1.Sheets(0).Columns<BR>    list.Add(column.Index, column.CellType)<BR>Next</P>
    <P>' After resetting DataSource or changing RowFilter.<BR>For Each column As Column In Me.FpSpread1.Sheets(0).Columns<BR>    column.CellType = list.Item(column.Index)<BR>Next</P>
    <P>C#</P>
    <P>// In form load code or other initialization code. </P>
    <P>{ <BR>    Dictionary<int, ICellType> list = default(Dictionary<int, ICellType>); <BR>    foreach (Column column in this.FpSpread1.Sheets(0).Columns) { <BR>        list.Add(column.Index, column.CellType); <BR>    } <BR>    <BR>    // After resetting DataSource or changing RowFilter. <BR>    foreach (Column column in this.FpSpread1.Sheets(0).Columns) { <BR>        column.CellType = list.Item(column.Index); <BR>    } <BR>} </P>
    <P> </P>
    <P><BR> </P>
  • Replied 8 September 2017, 2:05 pm EST

    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;">Hello John,<o:p></o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;"><o:p> </o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;">Can you please attach a small sample so that we can check this issue further at our end?<o:p></o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;"><o:p> </o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;">Also let us know the version of Spread for Windows Forms installed on your machine.<o:p></o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;"><o:p> </o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;">Regards,<o:p></o:p></SPAN></P>
    <P style="MARGIN:0in 0in 0pt;" class=MsoNormal><SPAN style="FONT-FAMILY:Verdana;FONT-SIZE:10pt;">Amit<o:p></o:p></SPAN></P>
  • Replied 8 September 2017, 2:05 pm EST

    <P>John,</P>
    <P>You can set the DataAutoCellTypes property to False to keep Spread from defaulting the CellTypes for the columns to the type it thinks best based on bound DataColumn.</P>
Need extra support?

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

Learn More

Forum Channels