October 11th, 2012, 12:06 PM
#1
insert value to listview from calculations
Hello guys, I'm beginner of C# here.. I already make my project for my research study in data mining....The problem comes when I need to put the value into listview from my calculation...Its outputs that I get is 123456 in horizontal...which is supposely the output is 123456 in vertical..so, its means, the listview have 6 rows where first row = 1, second row = 2, and so on...i give the picture so you guys can get clear what i mean...
from this picture, i build two element which is richtextbox and listview....from my calculation, i get 123456 in vertical at richtextbox....but i get 123456 in horizontal at listview....my question is, how to make my listview get the same pattern result as richtextbox...it is possible??
thank you for spending ur time read my problem
Attached Images
October 11th, 2012, 12:10 PM
#2
Re: insert value to listview from calculations
this is supposely be ....
October 11th, 2012, 12:13 PM
#3
Re: insert value to listview from calculations
the picture below, i get by hardcoded the file.txt
FileStream fileStreams = null;
StreamReader streamReaders = null;
DialogResult results = new DialogResult(); //Dialog result sets the openfile dialog result
results = openFileDialog1.ShowDialog();
string lines = "";
if (results == DialogResult.OK) // Test result.
{
files = openFileDialog1.FileName; // file 123456 in vertical
fileStreams = new FileStream(files, FileMode.Open);
streamReaders = new StreamReader(fileStreams);
while (!streamReaders.EndOfStream)
{
lines = streamReaders.ReadLine();
ListViewItem lvis = new ListViewItem(lines);
lv_SingleElement.Items.Add(lvis);
}
}
October 11th, 2012, 12:19 PM
#4
Re: insert value to listview from calculations
this is a calculation to find item support from transactions
string output1 = "";
string output = "";
ListViewItem u = new ListViewItem();
string lines = File.ReadAllText(@"C:\Users\ACER\Desktop\Apriori Demo\UCI dataset\testt.txt"); file Transactions
string list = "";
list = lines.Replace("\r\n", " ");
output += list;
string[] c = output.Split(' ');
List<String> cc = new List<String>(c);
cc.Sort();
var fr = cc.GroupBy(n => n).Select(n => new { Value = n.Key });
foreach (var f in fr)
{
string text2 = (string.Format("{0} ", f.Value));
output1 += text2 + "\n";
}
October 11th, 2012, 12:20 PM
#5
Re: insert value to listview from calculations
this is a calculation to find item support from transactions
string output1 = "";
string output = "";
ListViewItem u = new ListViewItem();
string lines = File.ReadAllText(@"C:\Users\ACER\Desktop\Apriori Demo\UCI dataset\testt.txt"); file Transactions
string list = "";
list = lines.Replace("\r\n", " ");
output += list;
string[] c = output.Split(' ');
List<String> cc = new List<String>(c);
cc.Sort();
var fr = cc.GroupBy(n => n).Select(n => new { Value = n.Key });
foreach (var f in fr)
{
string text2 = (string.Format("{0} ", f.Value));
output1 += text2 + "\n";
}
return output1;
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
On-Demand Webinars (sponsored)