Hi,
I have a page with ListView data control that is reading SQL Server Stored procedure and I have a good templete for displaying the selected data I get back.
Now, I am trying really hard to read my ListView items. Every item in my ListView has a "UserId" and I need on PageLoad() to read all the UserId on page.
How can I do that? I had real trouble to do that. I tried all kinds of foreach loops but nothing worked. Can you help?
What is the correct way to read all my data in my items in ListView with C# ?
========================================================================
protected void ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem item = (ListViewDataItem)e.Item;
DataRowView vw = (DataRowView)item.DataItem;
if (vw["UserName"].ToString().Equals("Something"))
{
// do something
}
}
}
==============================================================
Well, I did found code that worked for me in this forum - BUT I see it reads only the items that are display in one page because I use PAGING.
Can I check all my list items although I have paging , because now if I have 5 items in on page, it checks only this 5 items and not the 5 items at the next page. Can I do something in order to check ALL items in all Pages?
"Try not to become a man of success but rather a man of value." / Albert Einstein