S
SK
Hello,
I have a datagrid, textbox and a button in my page. The
datagtrid
has sorting enabled. But, I am not doing any sorting. Its
just for
test purpose. Now the user enteres some text in the
textbox and
presses the button and it response.writes the value of it.
Now when I
do a sort then the OnItemCreated Method is called, which
again calls
the test function, but it doesnt print the data from the
textbox. It
behaves like the textbox is empy, but it isnt. I can see
the value in
the textbox. I dont understand that all. Can somebody help
out?
Here is the code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim arList As New ArrayList
arList.Add("1")
arList.Add("2")
arList.Add("3")
DataGrid1.DataSource = arList
DataGrid1.DataBind()
End If
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Response.Write(TextBox1.Text)
End Sub
Public Function test()
Response.Write("testme" & TextBox1.Text)
End Function
Private Sub DataGrid1_OnItemCreated(ByVal sender As
Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs)
Handles
DataGrid1.ItemCreated
Select Case e.Item.ItemType
Case ListItemType.Header
test()
End Select
End Sub
Sub Sort(ByVal sender As Object, ByVal e As
DataGridSortCommandEventArgs)
End Sub
Thanks
I have a datagrid, textbox and a button in my page. The
datagtrid
has sorting enabled. But, I am not doing any sorting. Its
just for
test purpose. Now the user enteres some text in the
textbox and
presses the button and it response.writes the value of it.
Now when I
do a sort then the OnItemCreated Method is called, which
again calls
the test function, but it doesnt print the data from the
textbox. It
behaves like the textbox is empy, but it isnt. I can see
the value in
the textbox. I dont understand that all. Can somebody help
out?
Here is the code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim arList As New ArrayList
arList.Add("1")
arList.Add("2")
arList.Add("3")
DataGrid1.DataSource = arList
DataGrid1.DataBind()
End If
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Response.Write(TextBox1.Text)
End Sub
Public Function test()
Response.Write("testme" & TextBox1.Text)
End Function
Private Sub DataGrid1_OnItemCreated(ByVal sender As
Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs)
Handles
DataGrid1.ItemCreated
Select Case e.Item.ItemType
Case ListItemType.Header
test()
End Select
End Sub
Sub Sort(ByVal sender As Object, ByVal e As
DataGridSortCommandEventArgs)
End Sub
Thanks