Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Bind Gridview inside Data List view in VB.Net

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 779
    Comment on it

    Bind Gridview inside Data List view

    Some time we need to display content in tabular form in Data list. So we can use gridview inside in Datalist.

    Here we have to define the DataList_ItemDataBound event and find control of our gridview at the time of ItemDataBound event of DataList. After finding control of gridview in GridView type object, we have to pass datasource and bind datasource with this object.

     

    Protected Sub DLOrder_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DLOrder.ItemDataBound
            Dim grd As GridView = CType(e.Item.FindControl("GridView1"), GridView)
            
            Dim DtItem As DataTable = DataBase.GetDataTable("Sql Query")
            grd.DataSource = DtItem
            grd.DataBind()
    
        End Sub

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: