D
David C
I have a ListView control that is bound to a DataSource and I need to
recognize when I am in Insert mode and use code to setup my DropDownList
control selections. I am using the code below in the ItemDataBound event to
identify Edit mode and it works great.
'Get the item and row objects.
Dim dataItem As ListViewDataItem = CType(e.Item, ListViewDataItem)
Dim rowView As DataRowView = CType(dataItem.DataItem, DataRowView)
'Verify there is an item being edited.
If lvIncExpTrans.EditIndex >= 0 Then
' Check for an item in edit mode.
If dataItem.DisplayIndex = lvIncExpTrans.EditIndex Then
'all my edit row setup code is here...
End If
End If
For identifying Insert mode I am using code below but it does not appear to
be working.
If dataItem.ItemType = ListViewItemType.InsertItem Then
What should I be checking to see that my ListView is in Insert mode.
Thanks.
David
recognize when I am in Insert mode and use code to setup my DropDownList
control selections. I am using the code below in the ItemDataBound event to
identify Edit mode and it works great.
'Get the item and row objects.
Dim dataItem As ListViewDataItem = CType(e.Item, ListViewDataItem)
Dim rowView As DataRowView = CType(dataItem.DataItem, DataRowView)
'Verify there is an item being edited.
If lvIncExpTrans.EditIndex >= 0 Then
' Check for an item in edit mode.
If dataItem.DisplayIndex = lvIncExpTrans.EditIndex Then
'all my edit row setup code is here...
End If
End If
For identifying Insert mode I am using code below but it does not appear to
be working.
If dataItem.ItemType = ListViewItemType.InsertItem Then
What should I be checking to see that my ListView is in Insert mode.
Thanks.
David