ListView Properties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathewgk80
    New Member
    • Sep 2007
    • 103

    ListView Properties

    Hi all,

    I am trying to retrieve values from a ListView. I can find in some sites that

    ListView1.Selec tedItems[0].SubItems[0].Text is the code for retrieving first value from a ListView. But "SelectedIt ems" property is not available. I am using VS2008. c#.net. Any other namespace i have to add? I added "System.Web.UI. WebControls" namespace.

    Please Help me..

    Thanks and Regards,

    Mathew
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Well, there is .SelectedIndex and .SelectedValue. Hopefully those will help do what you need.

    Comment

    • mathewgk80
      New Member
      • Sep 2007
      • 103

      #3
      Originally posted by insertAlias
      Well, there is .SelectedIndex and .SelectedValue. Hopefully those will help do what you need.
      Thanks... Can you help me to retrieve second item in the first row of a ListView.

      Thanks in Advance,

      Mathew.

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Originally posted by mathewgk80
        Thanks... Can you help me to retrieve second item in the first row of a ListView.

        Thanks in Advance,

        Mathew.
        I don't think that it works that way. Look into the Item array, you'll see that it is a List of type ListViewDataIte m. There is no sub array. But ListViews have to be bound to a datasource, so why don't you get the value you're looking from from the datasource?

        Comment

        Working...