[flexgrid .4 version] Is there a property to replace displayindex?

Posted by: dagyoo on 22 June 2022, 11:45 am EST

  • Posted 22 June 2022, 11:45 am EST

    1. I want to know the position (Index) moved by dragging, not the initial default column position of FlexGrid.

    2. I want to set the column position using the index specified by the user. (order)

    Thanks for your reply.
  • Marked as Answer

    Replied 22 June 2022, 6:58 pm EST

    Hi,

    Thanks for reaching out to us with your query.

    1. You can get the dragged column position by handling DraggedColumn event:


    private void Dragged_Column(object sender, C1.WPF.FlexGrid.CellRangeEventArgs e)
    {
    MessageBox.Show("Dragged Position: " + e.Column);
    }


    2. You can set display order of column by setting Display.Order DataAnnotattions on bounded property in Model as:

    public class Product
    {
    [Display(Order =2)]
    public int Id { get; set; }
    [Display(Order = 1)]
    public string Name { get; set; }
    [Display(Order = 3)]
    public double Price { get; set; }
    }


    Please refer the attached sample for the same: CustomColumns.zip

    Best Regards,
    Nitin
Need extra support?

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

Learn More

Forum Channels