C1GanttView Read Only Grid Column

Posted by: john.morrelles on 15 March 2021, 8:51 am EST

    • Post Options:
    • Link

    Posted 15 March 2021, 8:51 am EST

    I want to make some of the columns in the grid part of the GanttView control read-only. It seems like the grid is a FlexGrid, which would support that, but I can’t find a way to reference just the FlexGrid part of the GanttView and I don’t see any explicitly exposed properties in GanttView for managing the columns in the gird.

  • Posted 16 March 2021, 6:44 am EST

    Hi John,

    There is no direct way to achieve your requirement but you can use the below-given code to do the same by accessing the grid part of GanttView:

    C1FlexGrid grid = c1GanttView1.Controls[2] as C1FlexGrid;
    grid.DrawMode = DrawModeEnum.OwnerDraw;
    grid.OwnerDrawCell += Grid_OwnerDrawCell;
             
    private void Grid_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
     {
        C1FlexGrid grid = c1GanttView1.Controls[2] as C1FlexGrid;
        grid.Cols[ColumnIndex].AllowEditing = false;
     }
    

    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