R
rhoenig
I have a gridview that is populated from a SortedList. In the
gridview I have a text box that the user can update, when they click
update I want to remove the entry from the list and readd it with the
updated item. My problem is when I try to get the text that is in the
cells of the gridview it returns nothing. I remove the item from the
list and that works fine so I know it's getting the proper row.
Here's my code. I found most of this on Microsoft's site.
<code>
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
' Retrieve the row that contains the button clicked
' by the user from the Rows collection.
Dim row As GridViewRow = destServersView.Rows(index)
' Create a new ListItem object for the Server Name in the
row.
Dim sName As New ListItem()
sName.Text = Server.HtmlDecode(row.Cells(0).Text)
' Create a new ListItem object for the Destination Folder
in the row.
Dim sDestFolder As New ListItem()
sDestFolder.Text = Server.HtmlDecode(row.Cells(1).Text)
Me.serverList.Remove(selectedIndex.ToString)
Me.serverList.Add(selectedIndex.ToString, sName.ToString &
"; " & sDestFolder.ToString)
</code>
Any suggestions.
Thanks
Robert
gridview I have a text box that the user can update, when they click
update I want to remove the entry from the list and readd it with the
updated item. My problem is when I try to get the text that is in the
cells of the gridview it returns nothing. I remove the item from the
list and that works fine so I know it's getting the proper row.
Here's my code. I found most of this on Microsoft's site.
<code>
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
' Retrieve the row that contains the button clicked
' by the user from the Rows collection.
Dim row As GridViewRow = destServersView.Rows(index)
' Create a new ListItem object for the Server Name in the
row.
Dim sName As New ListItem()
sName.Text = Server.HtmlDecode(row.Cells(0).Text)
' Create a new ListItem object for the Destination Folder
in the row.
Dim sDestFolder As New ListItem()
sDestFolder.Text = Server.HtmlDecode(row.Cells(1).Text)
Me.serverList.Remove(selectedIndex.ToString)
Me.serverList.Add(selectedIndex.ToString, sName.ToString &
"; " & sDestFolder.ToString)
</code>
Any suggestions.
Thanks
Robert