0
votes

I'm having difficulty with obtaining VisibleRowCount in my gridview. I have this particular gridview which I populate via
NewButton/> , inserting a new row, then populating each column, then attempting to do a save.

However whenever I do a save,

grdView.VisibleRowCount 

always returns zero. Even though the grid is populated, with clearly visible data.

Note: this gridview contains KeyFieldName="xxx", which I do not populate, when inserting a new row, via the Newbutton/>. I intend to populate this value in my save routine once I am able to access the data in the gridView. Might the fact be that this key field not being populated in the gridview be the problem? Is there a way to default that value via the NewButton/> function?

Thanks for any help.

1

1 Answers

0
votes

Refer: AspxGridView - VisibleRowCount always 0

Please note that the ASPxGridView control does not store data between server requests. Therefore, it is required to bind Grid on every request to the server. Refer to the Why might paging (sorting, grouping, filtering) not work in the ASPxGridView? KB article for additional details.

At the same time, visible GridView rows may be cached when the ASPxGridView.EnableRowsCache Property is set to True. Check if this property is True in your project. See the ASPxGridView Row Cache KB article for additional details.

There are lots of DevExpress thread explaining this behavior. Please check these:
DevExpress QA link