Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
foreach (GridViewRow gvrow in gvPM.Rows)
        {
            int usrid = Convert.ToInt32(gvPM.DataKeys[gvrow.RowIndex].Value);
            sqlDataSource.DeleteParameters["messageID"].DefaultValue = usrid.ToString();
            sqlDataSource.Delete();
        }


i using the top code to delete the row from the Gridview, how to convert it to listview?
Posted
Comments
manognya kota 16-Jan-12 8:45am    
Hi,
Can you clarify what you want to convert into list view?Or you want to delete an item from list view?
melvintcs 16-Jan-12 11:39am    
for some cases, i use listView, and for some cases i use gridView, the code above is to delete the row from the gridView(and database) which is working, now i have 1 listView which need to delete the record also like what gridView did. i need the same function code like gridView but use at listView =)
Tejas Vaishnav 16-Jan-12 8:49am    
why you need to convert it to list view, entire grid or any thing else..

and what to do after converting it to list view...

be specific with your question and provide more detail about what you want to do...

1 solution

dim listview1 as listview
listview1.item.removeat(selected.value())


adnan zaman
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900