Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello.
I have a question about refreshing listview in window. It looks like :
I have window with products on receipt on window1. on this window i have also button to split products between two receipts. So for example i have products:
Product1 10$
Product2 5,5%
Product3 20$
When i press button to split (this button show new window, lets call it Window2) i can move product from left side into another receipt, for example like:
Receipt1:
Product2
Product3

Receipt2:
Product1.

So in window2 i have 2 controls ListView (receipt1, receipt2) and button 'OK'. When i click this button i want to close window 2, and come back to window1, but only with items from receipt1 (on listview). So actually its like :
Window 1: receipt with all products + button to split receipt
Click on this button : window1 opacity = 0.2, window2 opacity = 1
window2.show, choose element to split between old receipt(from win1) and new one.
click ok on window2: window2.close, window1.opacity = 1 and now refresh items in listview.
is it possible to somehow refresh this window or even listview on it?
Posted

1 solution

This question has a lot of detail but its very confusing. My advice to you if you just want to simply refresh i listview is listview.Items.Refresh(), Otherwise if you want to be passing data back and forward through different windows. You need to create Properties and then send the information back and forward when creating and calling new instances of the windows. For example:

string Products;

C#
public string products
{
  get { return Products; }
  set { Products = value; }
}



When accessing Products

WindowName WN = new WindowName();
WN.Products = "new values";
WN.ShowDialog();

For more information on this if it doesnt make sence to you.
http://msdn.microsoft.com/en-us/library/x9fsa0sw(v=vs.80).aspx[^]

Tried to help from what i could understand from the question :) hope it can be of some use to you.
Storxstar
 
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