urgent-itemdatabound not getting called

S

samir dsf

hi

I had been using this datagrid for long. all well...but suddenly the
itemdatabound event is not at all getting called...i dont see my
links..initally it worked well

here is the page_load and itemdatabound event.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Me.IsPostBack Then
strSQL = "select CALLID, PROBLEM, REPORTED, CALLSTATUS
from CALLIDS where USERNAME='" & UserInfo.Username & "' and
(CALLSTATUS='OPEN' or CALLSTATUS='PENDING') order by CALLSTATUS desc"
BindData()
End If
End Sub

Sub BindData()
Try
GoToDBOpenConn(strSQL)
Dim dt As New DataTable
myDa.Fill(dt)
Me.dgDisplayModules.DataSource = dt
Me.dgDisplayModules.DataBind()
Catch ex As Exception
Throw ex
Finally
GoToDBCloseConn()
End Try
End Sub

Private Sub dgDisplayModules_ItemDataBound(ByVal sender As
System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)
Dim itemType As System.Web.UI.WebControls.ListItemType =
e.Item.ItemType
If ((e.Item.ItemType =
System.Web.UI.WebControls.ListItemType.EditItem) Or (e.Item.ItemType =
System.Web.UI.WebControls.ListItemType.Item) Or (e.Item.ItemType =
System.Web.UI.WebControls.ListItemType.SelectedItem) Or (e.Item.ItemType
= System.Web.UI.WebControls.ListItemType.AlternatingItem)) Then
Dim row As DataRowView = CType(e.Item.DataItem,
DataRowView)
Dim urlParams As String = "CallId=" +
row("CALLID").ToString()
Dim tabid As Int32 = 150
Dim tabid2 As Int32 = 172
e.Item.Cells(0).Text = "<A href='" &
DotNetNuke.Common.Globals.NavigateURL(tabid, "", urlParams) & "'
target=""_parent"">" + row("CALLID").ToString() & "</A>"
e.Item.Cells(1).Text = "<A href='" &
DotNetNuke.Common.Globals.NavigateURL(tabid2, "", urlParams) & "'
target=""_parent"">" + ByteArrayToString(row("PROBLEM")) & "...</A>"
End If
End Sub
 
B

Ben Amada

samir said:
I had been using this datagrid for long. all well...but suddenly the
itemdatabound event is not at all getting called...i dont see my
links..initally it worked well

Private Sub dgDisplayModules_ItemDataBound(ByVal sender As
System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)

I think that the "Handles dgDisplayModules.ItemDataBound" clause at the end
got deleted. If this is correct (and I could be wrong), then it should look
like:

Private Sub dgDisplayModules_ItemDataBound( _
ByVal sender As System.Object, _
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles dgDisplayModules.ItemDataBound

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top