问题描述
我有个DetailsView1我要怎么才能隐藏其中的一行呢?protectedvoidDetailsView1_ItemCreated(objectsender,EventArgse){DetailsView1.Rows[1].Visible=false;}这样怎么错了呢?
解决方案
解决方案二:
UP
解决方案三:
up
解决方案四:
把错误信息贴出来看下!
解决方案五:
ProtectedSubPage_Load(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.LoadIfNotIsPostBackThenCallrun()EndIfEndSubPrivateSubrun()DimlistsAsNewSystem.Collections.Generic.List(OfString)lists.Add("asp.net")lists.Add("xmlwebservices")DetailsView1.DataSource=listsDetailsView1.DataBind()EndSubProtectedSubDetailsView1_DataBound(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesDetailsView1.DataBoundIfDetailsView1.DataItem.ToString="asp.net"ThenDetailsView1.Rows(DetailsView1.DataItemIndex).Visible=FalseEndIfEndSubProtectedSubDetailsView1_PageIndexChanging(ByValsenderAsObject,ByValeAsSystem.Web.UI.WebControls.DetailsViewPageEventArgs)HandlesDetailsView1.PageIndexChangingDetailsView1.PageIndex=e.NewPageIndexrun()EndSub