.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Datagrid Footertemplate button visible false

Posted By: Catherine     Posted Date: December 12, 2011    Points:5   Category :VB.Net
hi, I would like to visible false my Datagrid Footertemplate button.

i used this coding

CType(DtGridRec.FindControl("btnadd"), Button).Enabled = False


Dim btnaddbutton As Button = CType(e.Item.FindControl("btnAdd"), Button)
btnaddbutton.Visible = False

but error coming as "Object reference not set to an instance of an object". pleasedo the needful

Author: Faizal             
Posted Date: December 15, 2011     Points: 20   

Hi Catherine,

It seems like you are not getting the btnAdd reference

check btnaddbutton reference is null or not

If btnaddbutton is Nothing // not sure about vb code

'your logic

in C#

if(btnaddbutton != null)
//your logic

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend