G
Guest
hi,
iam a having a datagrid,
pls check the code
----
Public WithEvents bgt As System.Web.UI.WebControls.DropDownList
---
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then ' pls don't add foooter
SqlDataAdapter2.SelectCommand.CommandText = "select * from Generalledger
where active=1 and Glaccounttype='" & GLTransactionType.SelectedValue & "'
order by glaccountno "
Dim ds As New DataSet
SqlDataAdapter2.Fill(ds, "Generalledger")
bgt = e.Item.FindControl("accountid")
bgt.ID = e.Item.ItemIndex
bgt.DataMember = "GeneralLedger"
bgt.DataValueField = "AccountID"
bgt.DataSource = ds.Tables(0).DefaultView
bgt.DataTextField = "GLAccountName"
bgt.AutoPostBack = True
bgt.EnableViewState = True
bgt.DataBind()
AddHandler bgt.SelectedIndexChanged, AddressOf
onSelectedIndexChangedevent
end if
end sub
---
and i have this code
Private Sub bgt_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles bgt.SelectedIndexChanged
Response.Write("<script>alert('Evnet chanrged!!!')</script>")
Response.Write(bgt.SelectedValue())
End Sub
-------
the above bgt event is not working, how should i change, or how i modify...
pls help me
thanks
iam a having a datagrid,
pls check the code
----
Public WithEvents bgt As System.Web.UI.WebControls.DropDownList
---
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then ' pls don't add foooter
SqlDataAdapter2.SelectCommand.CommandText = "select * from Generalledger
where active=1 and Glaccounttype='" & GLTransactionType.SelectedValue & "'
order by glaccountno "
Dim ds As New DataSet
SqlDataAdapter2.Fill(ds, "Generalledger")
bgt = e.Item.FindControl("accountid")
bgt.ID = e.Item.ItemIndex
bgt.DataMember = "GeneralLedger"
bgt.DataValueField = "AccountID"
bgt.DataSource = ds.Tables(0).DefaultView
bgt.DataTextField = "GLAccountName"
bgt.AutoPostBack = True
bgt.EnableViewState = True
bgt.DataBind()
AddHandler bgt.SelectedIndexChanged, AddressOf
onSelectedIndexChangedevent
end if
end sub
---
and i have this code
Private Sub bgt_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles bgt.SelectedIndexChanged
Response.Write("<script>alert('Evnet chanrged!!!')</script>")
Response.Write(bgt.SelectedValue())
End Sub
-------
the above bgt event is not working, how should i change, or how i modify...
pls help me
thanks