I have a gridveiw in which there is panal inside itemtemplate
i want to use this panle in by vb page . in type casting i use :
Dim Panel1 As Panel = CType(gridview1.FindControl("panel1"), Panel)
But it is not working............
C#
foreach (GridViewRow row in GridView1.Rows) { if (row.RowType == DataControlRowType.DataRow) { Panel panel1 = row.FindControl("Panel1") as Panel; } }
VB
For Each row As GridViewRow In GridView1.Rows If row.RowType = DataControlRowType.DataRow Then Dim panel1 As Panel = TryCast(row.FindControl("Panel1"), Panel) End If Next
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.