0

I have code like this with devexpress ASPxGridView. Everything goes well, but when I try to add new row, new row's textbox is disabled... I have KeyFieldName set.

 void BindGrid()
    {
       var AnnObj = SearchBarBanners.Select(i => new
        {
            Caption = i.Attribute("caption").Value,
            ID = i.Attribute("id").Value, // this is generated by Guid
        }).ToList();
        ImagesGrid.DataSource = AnnObj;
        ImagesGrid.DataBind();

    }
levi
  • 3,451
  • 6
  • 50
  • 86

2 Answers2

0

I can suggest you two things without grid markup:
1. Call BindGrid method in Page_Init
2. If your datasource initially returns zero rows, grid won't be able to determine type of objects that will be rendered in grid. You need to use ASPxGridView.ForceDataRowType in order to solve this problem.

Filip
  • 3,257
  • 2
  • 22
  • 38
0

Use recommendations from the Q392961 DX Article to resolve this issue.

Mikhail
  • 9,186
  • 4
  • 33
  • 49