I have a page with an UpdatePanel containing a couple of dropdowns, a retrieve button, and a RadGrid. The idea is that the user would select a set of data using the dropdowns, and click the retrieve button. This would then populate the grid, and the user would then be able to add/edit/delete the displayed data.
Simple enough, but there was a problem. The user could click on the "Add New Record" button at the top of the grid, which would display the the insert record control, when the selection criteria in the dropdowns had not been set. Clicking its "Inert" button would generate errors, because there were no selected values in the dropdowns.
My fast fix was to set "theGrid.Visible = False", and to make the grid visible only after the partial postback on the retrieve button. With this change, the insert record worked, but the edit existing record did not. When I clicked on the button in the GridEditCommandColumn, the little busy spinner spun, but the edit control was never displayed. It looks as if the grid isn't being properly initialized, if it's not visible on initial page load.
In any case, changing it to "theGrid.Enabled = False" made everything work fine.
Simple enough, but there was a problem. The user could click on the "Add New Record" button at the top of the grid, which would display the the insert record control, when the selection criteria in the dropdowns had not been set. Clicking its "Inert" button would generate errors, because there were no selected values in the dropdowns.
My fast fix was to set "theGrid.Visible = False", and to make the grid visible only after the partial postback on the retrieve button. With this change, the insert record worked, but the edit existing record did not. When I clicked on the button in the GridEditCommandColumn, the little busy spinner spun, but the edit control was never displayed. It looks as if the grid isn't being properly initialized, if it's not visible on initial page load.
In any case, changing it to "theGrid.Enabled = False" made everything work fine.