Winforms FarPoint and unsolicited fields

Posted by: senglory on 8 September 2017, 2:00 pm EST

  • Posted 8 September 2017, 2:00 pm EST

    My grind is explicitly binded by the following code:

    <FONT size=2>

    sv.Columns[0].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"ModelName"</FONT></FONT><FONT size=2>;


    sv.Columns[0].CellType = cellText;


    sv.Columns[0].Locked = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//VehiclePrice

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

    sv.Columns[1].CellType = cellCur;


    sv.Columns[1].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"VehiclePrice"</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>////FinanceAPR

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

    sv.Columns[2].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APR24PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns[3].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APR36PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns[4].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APR48PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns[5].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APR60PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns<img src="/emoticons/emotion-14.gif" alt="Devil" />.DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APR72PercDown"</FONT></FONT><FONT size=2>;


    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>////LeaseAPR

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

    sv.Columns[7].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APRL24PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns<img src="/emoticons/emotion-29.gif" alt="Music" />.DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APRL36PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns[9].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APRL39PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns[10].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APRL48PercDown"</FONT></FONT><FONT size=2>;


    sv.Columns[11].DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"APRL60PercDown"</FONT></FONT><FONT size=2>;</FONT>


    <FONT size=2></FONT> 

    <FONT size=2>

    But the datasource's rows contain much more fields. And the UI shows me all of them instead of being stopped at the explicitly defined list. How can I avoid this problem?

    </FONT>
  • Replied 8 September 2017, 2:00 pm EST

    Hello,

    You need to set the AutoGenerateColumns property to False and also set the column count of the Spread to the desired number of columns.

    <blockquote>

    FpSpread1.ActiveSheet.AutoGenerateColumns = False

    </blockquote>

    Hope this helps.Thanks

Need extra support?

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

Learn More

Forum Channels