0

A blank line is printed as if you had checked it in yellow in Gridview. I changed all the properties of Gridview but it did not disappear. How can I remove that empty row?

enter image description here

class Class1
{
    private List<MemberModel> sourceList;

    public MainForm()
    {
        InitializeComponent();

        SetGridControlData(this.sourceList);

        this.gridView.Columns.Clear();

        this.gridView.Columns.Add(GetGridColumn("idColumn"     , "ID"     , "아이디"     , true));
        this.gridView.Columns.Add(GetGridColumn("nameColumn"   , "Name"   , "이름"       , true));

    }

    private GridColumn GetGridColumn(string name, string fieldName, string caption, bool visible)
    { 
        GridColumn column = new GridColumn();

        column.Name      = name;
        column.FieldName = fieldName;
        column.Caption   = caption;
        column.Visible   = visible;

        return column;
    }

    private void SetGridControlData(List<MemberModel> sourceList)
    {
        this.gridControl.DataSource = sourceList;

        this.gridControl.RefreshDataSource();
    }
}

public class MemberModel
{
    public string ID{ get; set; }

    public string Name{ get; set; }
}

1 Answers1

2

In the DevExpress grid view, you can hide the new item row by setting NewItemRowPosition to NewItemRowPosition.None as described here. For example,

this.gridView.GridOptionsView.NewItemRowPosition = NewItemRowPosition.None;

steve16351
  • 5,372
  • 2
  • 16
  • 29