NissePPP
asked on
XPTable SelectionChanged
Need som help with SelectionChanged on the XPTable
http://www.codeproject.com/cs/miscctrl/XPTable.asp
I have this..
Private Sub TableTest_SelectedIndexCha nged(ByVal sender As System.Object, ByVal e As XPTable.Events.SelectionEv entArgs) Handles TableTest_.SelectionChange d
End sub
I need this for the XPTable
Private Sub ListView1_SelectedIndexCha nged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexCha nged
If (ListView1.SelectedItems.C ount) > 0 Then
Dim this As Integer = DirectCast(ListView1.Selec tedItems(0 ), ListViewItem).Index
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (ListView1.SelectedItems(0 ).SubItems (0).Text). ToString
End If
Catch ex As Exception
Throw ex
End Try
End If
End Sub
http://www.codeproject.com/cs/miscctrl/XPTable.asp
I have this..
Private Sub TableTest_SelectedIndexCha
End sub
I need this for the XPTable
Private Sub ListView1_SelectedIndexCha
If (ListView1.SelectedItems.C
Dim this As Integer = DirectCast(ListView1.Selec
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (ListView1.SelectedItems(0
End If
Catch ex As Exception
Throw ex
End Try
End If
End Sub
Confused.
Bob
Bob
ASKER
Ok..
I have a XPTable. it's a modified listview.
I need a function that works like my listveiw function.
This function is used when I need to collect data from a row. When selectedindex is changed.. I can get the row that the user has clicked on..
Private Sub ListView1_SelectedIndexCha nged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexCha nged
...........
.........
End sub
Now I need the same for my xptable..
And this is what I have now.. It works when selectedindex is change the te sub is executed,,
Private Sub TableTest_SelectedIndexCha nged(ByVal sender As System.Object, ByVal e As XPTable.Events.SelectionEv entArgs) Handles TableTest_.SelectionChange d
End sub
But I need the code inside this function . To get the data from the row.
I need this code for the xptable. It's not possible to just change the listview with the xptable.
So I need to translate this, so it works with xptable..
If (ListView1.SelectedItems.C ount) > 0 Then
Dim this As Integer = DirectCast(ListView1.Selec tedItems(0 ), ListViewItem).Index
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (ListView1.SelectedItems(0 ).SubItems (0).Text). ToString
End If
Catch ex As Exception
Throw ex
End Try
End If
I have a XPTable. it's a modified listview.
I need a function that works like my listveiw function.
This function is used when I need to collect data from a row. When selectedindex is changed.. I can get the row that the user has clicked on..
Private Sub ListView1_SelectedIndexCha
...........
.........
End sub
Now I need the same for my xptable..
And this is what I have now.. It works when selectedindex is change the te sub is executed,,
Private Sub TableTest_SelectedIndexCha
End sub
But I need the code inside this function . To get the data from the row.
I need this code for the xptable. It's not possible to just change the listview with the xptable.
So I need to translate this, so it works with xptable..
If (ListView1.SelectedItems.C
Dim this As Integer = DirectCast(ListView1.Selec
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (ListView1.SelectedItems(0
End If
Catch ex As Exception
Throw ex
End Try
End If
Where are you having problems with that code?
Bob
Bob
ASKER
I need this for the XPtable..
If (ListView1.SelectedItems.C ount) > 0 Then
Dim this As Integer = DirectCast(ListView1.Selec tedItems(0 ), ListViewItem).Index
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (ListView1.SelectedItems(0 ).SubItems (0).Text). ToString
End If
Catch ex As Exception
Throw ex
End Try
Eind if
But i can't just do this.. Xptable object name is TableTest
This dosen't work..
If (TableTest.SelectedItems.C ount) > 0 Then
Dim this As Integer = DirectCast(TableTest.Selec tedItems(0 ), ListViewItem).Index
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (TableTest.SelectedItems(0 ).SubItems (0).Text). ToString
End If
Catch ex As Exception
Throw ex
End Try
end if
If (ListView1.SelectedItems.C
Dim this As Integer = DirectCast(ListView1.Selec
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (ListView1.SelectedItems(0
End If
Catch ex As Exception
Throw ex
End Try
Eind if
But i can't just do this.. Xptable object name is TableTest
This dosen't work..
If (TableTest.SelectedItems.C
Dim this As Integer = DirectCast(TableTest.Selec
Dim strTemp As String
Try
If this >= 0 Then
' Get the marked item from listview
strTemp = (TableTest.SelectedItems(0
End If
Catch ex As Exception
Throw ex
End Try
end if
If you are using XPTable.Models.Table, it has the SelectionChanged event, and this:
XPTable.Models.Row row = this.table.SelectedItems[0 ];
Bob
XPTable.Models.Row row = this.table.SelectedItems[0
Bob
ASKER
Hmm ok, but I need to get the iitem from the selected row
strTemp = (TableTest.SelectedItems(0 ).SubItems (0).Text). ToString ...but with xxptable code..
how does
XPTable.Models.Row row = Me.table.SelectedItems(0)
get the selected row from my XpTable and into my string variable.
I'm new on this sorry.. :(
strTemp = (TableTest.SelectedItems(0
how does
XPTable.Models.Row row = Me.table.SelectedItems(0)
get the selected row from my XpTable and into my string variable.
I'm new on this sorry.. :(
XPTable.Models.Row row = this.table.SelectedItems[0 ];
string strTemp = row.Cells[0].Text;
Bob
string strTemp = row.Cells[0].Text;
Bob
ASKER
Thx.. works great. But how do I count the selected rows.
I want to do this.. But I can't find count.
TableTest.SelectedItems.Co unt
I want to do this.. But I can't find count.
TableTest.SelectedItems.Co
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is the complete code if any want it..
Thx Bob for all the help.. :)
Private Sub TableTest_SelectedIndexCha nged(ByVal sender As System.Object, ByVal e As XPTable.Events.SelectionEv entArgs) Handles TableTest.SelectionChanged
If (TableTest.SelectedItems.L ength) > 0 Then
Dim this As Integer = DirectCast(TableTest.Selec tedItems(0 ), XPTable.Models.Row).Index
Dim strTemp As String
Dim row As XPTable.Models.Row
Try
If this >= 0 Then
' Get the marked item from listview
row = Me.TableTest.SelectedItems (0)
strTemp = row.Cells(0).Text
End If
Catch ex As Exception
Throw ex
End Try
End If
End sub
Thx Bob for all the help.. :)
Private Sub TableTest_SelectedIndexCha
If (TableTest.SelectedItems.L
Dim this As Integer = DirectCast(TableTest.Selec
Dim strTemp As String
Dim row As XPTable.Models.Row
Try
If this >= 0 Then
' Get the marked item from listview
row = Me.TableTest.SelectedItems
strTemp = row.Cells(0).Text
End If
Catch ex As Exception
Throw ex
End Try
End If
End sub
ASKER
This works.. (For Each...) )bur I want the strTemp = (ListView1.SelectedItems(0
For Each row As XPTable.Models.Row In TableTest.TableModel.Selec
' 'show the item in your first column
MessageBox.Show(row.Cells(
Next
I have tested this but this only selects the row and cell I i want, but I need the row the user selects .
strTemp = TableTest.TableModel.Item(
Maybe this code can help..