neerajMAX
neerajMAX

Reputation: 269

adding controls in listview

i am using .NET CF making application in window mobile.

need want to add textboc in third column of listview. googled it but only getting solution for web application.

aint it possible in window mobile ????

code i tried so far... (although it is not working :-) )

     for (int i = 0; i < soups.Length; i++)
      {
         ListViewItem li = new ListViewItem();
         li.Text = "RSO" + (i+1);
         li.SubItems.Add(arrval[i]);

         //in 1st attemp i  tried                                             
         li.SubItems.Add(new TextBox());
         //in 2nd attemped           
         TextBox tbox =  new TextBox();  
         li.SubItems.Add(tbox);


         li.SubItems.Add(Convert.ToString(5 * (i + 1)));
         li.SubItems.Add(Convert.ToString(35 * (i + 1)));
         lst_option.Items.Add(li);
      }

but both ways not working.... bcz of obvious reasons as i am trying to add obj in add() method instead of string :) :)

thnkx in advance

Upvotes: 0

Views: 2501

Answers (1)

ctacke
ctacke

Reputation: 67168

None of the out-of-the-box controls for the Compact Framework (ListView, ListBox, DataGrid, etc) provide this capability. The common work-around is to place a separate TextBox on the form and when a ListViewItem is selected, move the Textbox to cover the location of the subitem/cell, put the subitem/cell text into the TextBox, then make it visible.

Upvotes: 2

Related Questions