Home Forums WinForms controls Xceed Grid for WinForms Cannot hide DetailGrid columns.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #12951 |

    Hi!

    I have a Master/DetailGrid wich populates fine with a dataset,
    but when i should hide columns in the detail grids they will not hide.

    Anybody having a clue about this?

    ———————————–
    // Hide MasterGrid Columns.
    // Hiding this column works fine!
    this.MasterGrid.Columns[“Col1”].Visible = false;

    // Hide DetailGrid1 Columns.
    // This column will not hide!
    this.DetailGrid1.Columns[“Col1”].Visible = false;

    // Hide DetailGrid2 Columns.
    // These columns will not hide!
    this.DetailGrid2.Columns[“Col1”].Visible = false;
    this.DetailGrid2.Columns[“Col2”].Visible = false;
    ———————————

    Regards,
    Benny

    Imported from legacy forums. Posted by Benny (had 3259 views)

    User (Old forums)
    Member
    Post count: 23064

    I had the same problem and solved it by doing it the following way. Not sure if there is a better way as I have just started evaluating the grid for our company.

    this.DetailGridTemplates.Item(0).Columns(“Col1”).Visible = False

    Imported from legacy forums. Posted by DGamblin (had 331 views)

    User (Old forums)
    Member
    Post count: 23064

    Don’t use DetailGridTemplates.
    Instead access a detailGrid directly:

    this.gridControl1.DataRows[0].DetailGrids[0].Columns[“Col1”].Visible = false;

    Imported from legacy forums. Posted by C# (had 223 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you, now it’s working fine. 😀

    Regards,

    Imported from legacy forums. Posted by Benny (had 4167 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.