multiple datakeys in datalist

Last post 06-25-2009 9:51 AM by xxxd. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-24-2009 6:38 AM

    multiple datakeys in datalist

     Hi Sonu,

    Is there a way to have multiple datakeys in datalist?

    Praveen

  •  Advertisement

    Featured Advertisement

     
  • 06-24-2009 10:01 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: multiple datakeys in datalist

     Yes, i think there is. Just like GridView, you can specify multiple keys.

    DataKeyField

    ="id,name"

    you can access the keys with datalist.DataKeys[index]

  • 06-24-2009 11:25 AM In reply to

    Re: multiple datakeys in datalist

     I have tried this option but it doesnt work.

    Iget a script error saying -
    Message: Sys.InvalidOperationException: Specified ID,Name does not exists in dataSource.

     

     

  • 06-24-2009 12:26 PM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: multiple datakeys in datalist

     check the datasource you get, does it even have column names such as id, name?

  • 06-25-2009 8:27 AM In reply to

    Re: multiple datakeys in datalist

     yes it has. I have even tried on the sample code provided. it doesnt work.

  • 06-25-2009 9:21 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,091
    • MVP

    Re: multiple datakeys in datalist

    Multiple dataKeyNames are not supported. If you would like to suggest this feature, please add to the issue tracker:

    http://ajaxdatacontrols.codeplex.com/WorkItem/List.aspx

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 06-25-2009 9:51 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: multiple datakeys in datalist

     oh, I am sorry. The whole time I was thinking you were using a regular asp .net datalist

Page 1 of 1 (7 items)