views:

48

answers:

3

Hi,

I wonder why I cant access Object by ClientInstanceName from javascript.

example:

function NextStep(pageControl) {
        currentStep = pageControl.GetActiveTabIndex();
        switch (currentStep) {
            case 0:
                selectedRowsCount = GridViewClient.GetSelectedRowCount();
break;
}

The error is:

There is no definition for GridViewClient;

but ClientInstanceName is set to GridViewClient

Case is that I have thos grid on other tabs in ASPxPageControl so that these aren't visible but What I want to do is to refresh one of it before displaying it and I wanted to use client side ASPxGridViewClient.Refresh().

+1  A: 

Have you set GridViewClient to disabled=true? As per this entry on the dx forums, this will result in no client-side object being created.

Rob
+1  A: 

Hi,

I think that you are using the ASPxPageControl in a non client side mode. I.e. either AutoPostBack property is true or EnableCallbacks property is true. In this case, only the active tab page content is rendered and thus controls on inactive tabs are not available.

DevExpress Team
EnableCallbacks is set to true. What does this really mean ?
gruber
+1  A: 

This means that the ASPxPageControl sends a callback to the server every time you activate a new tab. This callback is necessary to obtain the content of the active tab and show it on the client. So, this approach reduces the time needed to load a page as a small content is sent to the client side. Note, that if the EnableCallbacks is set to true, the ASPxPageControl caches its contents on the client side. So, when you activate a Tab which was already active, a callback is not sent and thus tab is activated using the pure client side code.

DevExpress Team
great now everything is clear for me :) So I will stay using EnableCallbacks = true
gruber