Checkbox visual difference upgrading flexgrid

Posted by: p4spares on 16 March 2020, 8:39 am EST

    • Post Options:
    • Link

    Posted 16 March 2020, 8:39 am EST

    hi,

    i’m having a problem with checkbox columns upgrading an application devloper from flexgrid 4.0.20162.188 to 4.0.20193.393.

    the checkbox sizes is bigger, but i cannot find a reason for that.

    from this (4.0.20162.188):

    to this (4.0.20193.393):

    extract a sample from the application is not easy, i’m going to try to recreate the same situation.

    while i do this test… anybody had the same problem before?

    thanks,

    David

  • Posted 17 March 2020, 1:28 am EST

    Hi David,

    Sorry but we can not replicate the issue at our end, please see the attached screenshots for reference.

    It will be very helpful if you could modify the attached sample accordingly replicating the issue so that we can assist you properly.

    Regards,

    Prabhat Sharma.

    C1FlexGridCheckDemo.zip

  • Posted 17 March 2020, 2:45 am EST

    hi Prabhat,

    i also did some testing yesterday, and you are right, the “problem” is not connected with C1.

    during the upgrade, customers also wanted to change default font with a bigger one. this created the problem. cell now is bigger and flexgrid try to cover all the space with the checkbox.

    if i want to keep the “system checkbox size”, very probably i have to use owner draw cell + checkboxrenderer.drawcheckbox.

    thanks,

    David

  • Posted 17 March 2020, 3:25 am EST

    Hi David,

    If you want to achieve your desired output then in spite of setting the font property at grid level, you can set it at column level for those columns where you want it to be applied. This will keep the checkbox in the Boolean column as normal size.

          ```
    

    private void Form1_Load(object sender, EventArgs e)

    {

    c1FlexGrid1.Rows.Count = 6;

    c1FlexGrid1.Cols[1].Caption = c1FlexGrid1.Cols[1].Name = “CheckBox”;

    c1FlexGrid1.Cols[2].Caption = c1FlexGrid1.Cols[2].Name = “Text”;

    c1FlexGrid1.Cols[1].DataType = typeof(Boolean);

    c1FlexGrid1.SetCellCheck(1, 1, C1.Win.C1FlexGrid.CheckEnum.Grayed);

    c1FlexGrid1.SetCellCheck(2, 1, C1.Win.C1FlexGrid.CheckEnum.Grayed);

    c1FlexGrid1.SetCellCheck(3, 1, C1.Win.C1FlexGrid.CheckEnum.Grayed);

    c1FlexGrid1.SetCellCheck(4, 1, C1.Win.C1FlexGrid.CheckEnum.Grayed);

    CellStyle cs = c1FlexGrid1.Styles.Add(“X”);

    cs.Font = new Font(“”, 14, FontStyle.Bold);

    c1FlexGrid1.Cols[2].Style = cs;

    c1FlexGrid1[1, 2] = “Demo wcr”;

    c1FlexGrid1[2, 2] = “Demo xys”;

    c1FlexGrid1[3, 2] = “Demo bcx”;

    c1FlexGrid1[4, 2] = “Demo jkh”;

    c1FlexGrid1.AutoSizeRows();

    c1FlexGrid1.AutoSizeCols();

    }

    
    Regards,
    Prabhat Sharma.
Need extra support?

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

Learn More

Forum Channels