Formatting the data ,when spread in binded to dataset.

Posted by: vkempanna on 8 September 2017, 12:50 pm EST

  • Posted 8 September 2017, 12:50 pm EST

    <P>Hi,</P>
    <P>I am using Spread 3.0.</P>
    <P>In my application i have a spread which is binded to Dataset.</P>
    <P>The Dataset has a column  whose datatype is of boolean.</P>
    <P>when the value in this column is "True" i  want to display value "Yes"  in spread and when the value in </P>
    <P>column is "False" , i want to display value "No" in spread.</P>
    <P>While saving back the changes i want store "True" in the Dataset if the spread has value "Yes" and "False" if the spread has value "No".</P>
    <P>How can  this be accomplished?</P>
    <P>Regards</P>
    <P>Vinutha </P>
  • Replied 8 September 2017, 12:50 pm EST

    <P>Vinutha,</P>
    <P>You can define a Column's CellType as a CheckBoxCellType as follows to get this behavior.</P> <PRE class=coloredcode> <SPAN class=kwd>Dim</SPAN> c <SPAN class=kwd>As New</SPAN> FarPoint.Win.Spread.CellType.CheckBoxCellType
    c.TextTrue = <SPAN class=st>"Yes"</SPAN>
    c.TextFalse = <SPAN class=st>"No"</SPAN>

    FpSpread1.Sheets(0).Columns(1).CellType = c
    FpSpread1.Sheets(0).Cells(0, 1).Value = <SPAN class=kwd>False</SPAN>
    FpSpread1.Sheets(0).Cells(1, 1).Value = <SPAN class=kwd>True</SPAN>
    </PRE> 
Need extra support?

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

Learn More

Forum Channels