ListView
-
Hi , I am trying to liken the ListView to a dataGrid.. Lets say we have a dataTable and a ListView.. In order to simulate dataGrid , we would like to known how many colums do we have , before binding the items into the ListView , I create the columns...
for ( int j =0 ;j Then , I consider to bind each dataRow into the ListView with the corresponding columns.. `for ( int i = 0 ; i Do you have any idea what I am doing wrong ?`
-
Hi , I am trying to liken the ListView to a dataGrid.. Lets say we have a dataTable and a ListView.. In order to simulate dataGrid , we would like to known how many colums do we have , before binding the items into the ListView , I create the columns...
for ( int j =0 ;j Then , I consider to bind each dataRow into the ListView with the corresponding columns.. `for ( int i = 0 ; i Do you have any idea what I am doing wrong ?`
You're adding the column name over and over again ? It would help if you said what is actually GOING wrong. Why are you using a listview if you want a datagrid ? Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
-
You're adding the column name over and over again ? It would help if you said what is actually GOING wrong. Why are you using a listview if you want a datagrid ? Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
Thanks for the reply , May be because of the style of the text , you cant see right , I only add the columns to the listView in the first loop, then I add values to those columns.. well it seems like , the values are ok , by this code..But I guess , I made the ListView nervous , treating like a dataGrid.May be you are right, I was just looking for fun , and develop some UI skills...:laugh:
StringBuilder s = new StringBuilder(); foreach (ListViewItem li in this.listView1.Items) { s.Append(li.Text); for(int k =0;k
-
Thanks for the reply , May be because of the style of the text , you cant see right , I only add the columns to the listView in the first loop, then I add values to those columns.. well it seems like , the values are ok , by this code..But I guess , I made the ListView nervous , treating like a dataGrid.May be you are right, I was just looking for fun , and develop some UI skills...:laugh:
StringBuilder s = new StringBuilder(); foreach (ListViewItem li in this.listView1.Items) { s.Append(li.Text); for(int k =0;k
ok , At last I found the reason, ColumnHeader Collection can not be work with listView(or I cant do it)
ColumnHeader [] h = new ColumnHeader[ColumnCount]; for (int i=0;i After I declare ColumnHeader one by one , it works fine.. Do you see any syntax or algorithm errors in Column Header Collection that I created?
-
ok , At last I found the reason, ColumnHeader Collection can not be work with listView(or I cant do it)
ColumnHeader [] h = new ColumnHeader[ColumnCount]; for (int i=0;i After I declare ColumnHeader one by one , it works fine.. Do you see any syntax or algorithm errors in Column Header Collection that I created?
it's not a collection, its an array as you have created it using array syntax. Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed. Carl Sandburg