views:

82

answers:

3

I want to change controls visibility on c#, but nothing happens. The controls are in an AspxPopupControl and 3 of them are hidden in design time, 1 of them is visible. I use this code to visible them

if (paramType == "Grup")
            {
                gv_Answers.Visible = false;
                trlGroup.Visible = true;
                chkShowItems.Visible = true;

            }
            else
            {
                gv_Answers.Visible = true;
                trlGroup.Visible = false;
                chkShowItems.Visible = false;
            }

This code is in a CustomCallBack event of a gridview. So i don't know what to do from this point. It's an easy task but i couldn't handle it.

Thanks for you helps

A: 

Hi,

The cause of this problem is that you are changing the control's visibility within the ASPxGridView's callback. The callback response contains only the information about control who initiated the callback and its child controls. Since the ASPxPopupControl is not a part of the GridView, the problem appears. The easiest solution is to implement this code within a PostBack event, not a callback. In this case, everything will work correctly.

DevExpress Team
A: 

Thank you, that fixed the problem. I have one more question, i have a treelist in that popupcontrol and i bind it with some data. But i want to expand all nodes after i bind it. I use this code:

trlGroup.DataSource = gnlTreeDColl;
trlGroup.ExpandAll();
trlGroup.DataBind();

Also set this property

<SettingsBehavior AllowFocusedNode="True" AutoExpandAllNodes="true"/>

but it doesn't expand all nodes. How can i fix it?

Thank you.

mehmetserif
A: 

Hi,

Please change the order your code is executed:

trlGroup.DataSource = gnlTreeDColl;
trlGroup.DataBind();
trlGroup.ExpandAll();

This should work.

DevExpress Team
it didn't work, is it also because of gridview's callback function? Becuase in that callback function, i call a method to bind treelist.
mehmetserif
Yes. This is the cause
DevExpress Team