Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear all
am using ASP.NET, I created a procedure to retrieve a data table and set the gridview data source property to be equal that data table.
the data table has data, but when I set the data source of the grid to be equal my data table and bind data, nothing happens, and the grid view is still hidden.
I checked the visible property, it is true.

VB
grdPageContents.DataSource = MyDataTable
grdPageContents.DataBind()


can you help me please?
Posted
Comments
Mario Majčica 23-Aug-12 4:58am    
Can you show us how the grid is defined in aspx file?
bbirajdar 23-Aug-12 5:01am    
There is no data in 'MyDataTable'

1 solution

Please check the visibility mode, i mean u may be written a code for hides the grid some where of the code ,

Please add a code to visible the grid after ur code;

VB
grdPageContents.DataSource = MyDataTable
grdPageContents.DataBind()
grdPageContents.Visibe = True;



Cheers...
 
Share this answer
 
Comments
fadi77_net 23-Aug-12 5:46am    
No, I did't write any code to hid the grid, and I followed your code, I set the Visible property to True, but there is nothing happened.
dilzz 23-Aug-12 6:45am    
Did u use any pannel, or update pannel ? If u used it, then please remove those pannels and try again .
fadi77_net 26-Aug-12 8:02am    
No dilzz, it is not contained in any panel or update panel.
fadi77_net 27-Aug-12 4:54am    
Actually I checked the code, I wrote the code in the click event of the button, and it is not working, but if I write the code in the load event of the page, it will work, so how can I run the code from the button?
dilzz 27-Aug-12 5:02am    
Is the button is placed inside the update pannel.?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900