This is a migrated thread and some comments may be shown as answers.

Problem with visibility command on button

2 Answers 298 Views
Button
This is a migrated thread and some comments may be shown as answers.
Carina
Top achievements
Rank 1
Carina asked on 22 Jan 2013, 12:22 AM
So I have a radgrid on a form. right before the radgrid aspx code starts, I have set the row property of visible = false (ex:
<tr runat="server" id="rw1" visible="false">
On my code behind (using VB.NET) I have set the btnShowGrid_Click event to this:
rw1.visible = true
grd1.visible=true
btnHideGrid.visible = true
....
The problem I am encountering is that I press this button for the first time on the form and it will only show the row, so I have to click it again to show the radgrid.
When I click on the "Hide Grid" button, the row and grid hide, and then I click the "Show Grid" button again and everything is displayed, I dont need to click on it again.
Why is this happening?

By the way the radgrid visible property is set to true not false.

2 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 23 Jan 2013, 08:02 AM
Hi Carina,

I was not able to reproduce your issue, as I do not have enough information about your case - which event handlers do you use and how, is your grid databound and how, etc. Nevertheless I have attached my VS test pages in the RadButton_RadGrid_hide_Vb.zip archive. Could you compare your actual page with mine and try to find the difference that is causing this problem? If you still cannot resolve the problem could you try to reproduce the issue with my sample, and if it is related to our products then send it back to us, so we can inspect it locally?

What I can suggest as additional troubleshooting steps are the following:
- make sure the grid is properly databound when you make it visible. If it does not have a proper datasource it cannot show data
- if you are showing the control during an AJAX request the problem could be that it cannot register its skins (stylesheets go in the head section and it is not updated during a partial postbak). In that case you can try setting the grid's EnableAjaxSkinRendering property to true before making it visible.

All the best,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Carina
Top achievements
Rank 1
answered on 05 Feb 2013, 09:58 PM
Thank you! 
I had to do the Databind() in the pageload and it got fixed :)
Tags
Button
Asked by
Carina
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Carina
Top achievements
Rank 1
Share this question
or