|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OnItemDataBound ProblemI created a DataGrid programmatically, my problem is that I dont know how to associate a function with the OnItemDataBound event of the Datagrid if it's created programmatically. Would anyone help me do this? Any help will be much appreciated. Thanks! Mayet Here is a sample code... Dim oGrd As DataGrid oGrd = New DataGrid() Dim oDS As DataSet = New DataSet() oDS = oPL.GetReport() grdPayroll.DataSource = oDS grdPayroll.DataBind() Private Sub grdItemDataBound() .... End Sub > I created a DataGrid programmatically, my problem is that I dont know Hello Mayet,> how to associate a function with the OnItemDataBound event of the > Datagrid if it's created programmatically. This should do it: ---- Protected WithEvents dg As DataGrid Private Sub myDataboundHandler(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dg.ItemDataBound 'code goes here. End Sub Jeppe Jespersen mayet***@gmail.com wrote:
Show quoteHide quote > Hi, AddHandler oGrd.ItemDataBound, AddressOf grdItemDataBound> > I created a DataGrid programmatically, my problem is that I dont know > how to associate a function with the OnItemDataBound event of the > Datagrid if it's created programmatically. > > Would anyone help me do this? > > Any help will be much appreciated. > > Thanks! > > Mayet > > > Here is a sample code... > > Dim oGrd As DataGrid > oGrd = New DataGrid() > > Dim oDS As DataSet = New DataSet() > oDS = oPL.GetReport() > > grdPayroll.DataSource = oDS > grdPayroll.DataBind() > > Private Sub grdItemDataBound() .... > End Sub -- Riki
Bees knees of grid controls for ASP.NET
Datagrid Not Displaying Changea buttoncommand for one record only Retreive values from invisible cell Data Grid Disappears after postback Creating News page the dotnet way playing around a DataGrid DataGrid with manual dataSource Quick! Simple method for editing a nested datagrid! DataGridPageChangedEventHandler not firing |
|||||||||||||||||||||||