views:

89

answers:

2

Hello,

Im implementing custrom delete by adding to my ASPxGridView GridViewColumnCustomButton.

Then on my GridView I handle ClientSideEvent

<ClientSideEvents CustomButtonClick="function(s, e) { customButton_OnClick(s, e); }" />

JS:

function customButton_OnClick(s, e) {
        if (e.buttonID == "customButtonId") {
            e.processOnServer = confirm("Really want to delete?");
        }
    }

Ive also added to my grid:

OnCustomButtonCallback="GvMyGridViews_OnCustomCallback"

now on the server side I user linq to delete specified row and then submit changes to my DataContext and then DataBind() on my grid.

Problem is that sometimes standard ASPxGridView loading panel is shown for about 1 second ant then my row dissapears so it behaves properly but sometimes loading panel stops mooving. and I need to move mouse over my grid or click button so that my Grid is updated(row dissapears).

Have You got any Idea where the problem is ? Thanks for help

+1  A: 

Hi,

It it hard to answer your question. Please try to determine if the row was actually deleted from the DB when you call the grid's DataBind method. Also, I suspect that the ASPxGridView is bound to a LinqDataSource object. If so, I suggest that you log which data it returns and check if a row deleted is in the list. It is possible since this component can cache data and return a non valid recordset. To determine which data is returned by the LinqDataSource, you may use the code from

http://forums.asp.net/p/1583916/3998100.aspx

DevExpress Team
Problem is that when I click on that web site or simply move mouse over the grid loadingPanel disapears and grid is displayed correctly. As I said it isnt deterministic, sometimes grid behaves well sometimes bad.
gruber
Do you see this behavior on your particular machine or it is reproducible on different machines? In which browser do you see this behavior?
DevExpress Team
Yes its reproducible, I tried on Firefox and IE, whats interesting when I hit breakpoint In the Load_Page end then resume application loading panel works correctly and grid is refreshed.
gruber
A: 

Make sure that after you delete the record at the end of your custombuttoncallback handler that you SET THE DATASOURCE then rebind the grid. If you just call DataBind() without setting the datasource it will not work properly. Ie.

  aspxGrid.DataSource = updatedDataSourceAfterTheDelete;
  aspxGrid.DataBind();
Andre Santos