J
John A Grandy
anyone know why this is ?
Imports System.Data
Imports System.Diagnostics
Public Class WebForm12
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents dg1 As System.Web.UI.WebControls.DataGrid
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dcc As DataColumnCollection
Dim dr As DataRow
Dim drc As DataRowCollection
Dim dt As DataTable
Try
If Not Page.IsPostBack Then
dt = New DataTable
dcc = dt.Columns
dcc.Add("Col1", GetType(String))
dcc.Add("Col2", GetType(String))
drc = dt.Rows
dr = dt.NewRow
dr(0) = "abcd"
'dr(1) = ""
drc.Add(dr)
dr = dt.NewRow
dr(0) = "efgh"
'dr(1) = ""
drc.Add(dr)
dg1.DataSource = dt.DefaultView
dg1.DataBind()
End If
Catch ex As Exception
Debug.WriteLine(ex.Source & " " & ex.Message)
Finally
End Try
End Sub
Public Sub dg1_ItemCommand(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim dgi As DataGridItem
Dim s As String
Dim s1 As String
Try
dg1.SelectedIndex = e.Item.ItemIndex
dgi = dg1.SelectedItem
s = dgi.Cells(1).Text
'Debug mode mouse-over reveals s = " "
s1 = Trim(Server.HtmlDecode(s))
Catch ex As Exception
Debug.WriteLine(ex.Source & " " & ex.Message)
Finally
End Try
End Sub
End Class
Imports System.Data
Imports System.Diagnostics
Public Class WebForm12
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents dg1 As System.Web.UI.WebControls.DataGrid
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dcc As DataColumnCollection
Dim dr As DataRow
Dim drc As DataRowCollection
Dim dt As DataTable
Try
If Not Page.IsPostBack Then
dt = New DataTable
dcc = dt.Columns
dcc.Add("Col1", GetType(String))
dcc.Add("Col2", GetType(String))
drc = dt.Rows
dr = dt.NewRow
dr(0) = "abcd"
'dr(1) = ""
drc.Add(dr)
dr = dt.NewRow
dr(0) = "efgh"
'dr(1) = ""
drc.Add(dr)
dg1.DataSource = dt.DefaultView
dg1.DataBind()
End If
Catch ex As Exception
Debug.WriteLine(ex.Source & " " & ex.Message)
Finally
End Try
End Sub
Public Sub dg1_ItemCommand(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim dgi As DataGridItem
Dim s As String
Dim s1 As String
Try
dg1.SelectedIndex = e.Item.ItemIndex
dgi = dg1.SelectedItem
s = dgi.Cells(1).Text
'Debug mode mouse-over reveals s = " "
s1 = Trim(Server.HtmlDecode(s))
Catch ex As Exception
Debug.WriteLine(ex.Source & " " & ex.Message)
Finally
End Try
End Sub
End Class