I have used the GridView inside the ListView. I want to dynamically change a cell value. For example, there is a column named “Time”, I wanna to change this value when something happens. I can find and get the cell (e.g od.Time as in following codes), but can not change its value. Some codes like this where ObjectData is the class for all ListView columns.
for (int i = 0; i < 5; i++)
{
ObjectData od = (ObjectData)objectListView.Items[i];
if (od.UserName == "Tom")
{
od.Time = DateTime.Now.ToString();
}
}
If the your listview is bound to a data source you’ll need to change the data source’s data, not the listview’s contents. It should then update the listview.