Dynamic columns in repeater

Last post 10-31-2008 3:41 PM by jnsuryaprakash. 3 replies.

Sort Posts:

  • Dynamic columns in repeater

    10-31-2008, 1:47 PM
    • Member
      341 point Member
    • unosinu
    • Member since 12-17-2005, 7:03 AM
    • Posts 145

    Hi,

    I want to create a repeater control in such a way that initially I need to have only say maybe 3 columns and as and when I get more information based on user input I need to add columns to the repeater. Is there a way where I can create a template and reuse it all over?

    Thanks

  • Re: Dynamic columns in repeater

    10-31-2008, 2:49 PM
    • Participant
      1,154 point Participant
    • jnsuryaprakash
    • Member since 10-14-2008, 4:45 PM
    • connecticut
    • Posts 232

    One option i can think of is build user control with repeater. In the code behind on the input you will be adding rows to table and binding the table to the repeated as a datasource might be an option.

    Thanks,
    Surya Prakash Jayanti
    http://suryaprakashj.blogspot.com
    http://jnsuryaprakash.blogspot.com
    http://sqlserver-qa.net/blogs/dotnet_40/default.aspx

    p.s. Please click "Mark as Answer" if you think this post answered your question
  • Re: Dynamic columns in repeater

    10-31-2008, 3:03 PM
    Answer
    • Member
      341 point Member
    • unosinu
    • Member since 12-17-2005, 7:03 AM
    • Posts 145

    Sorry, I think you misinterpreted my statement. I dont want to add rows. I have a fixed number of rows which I have bound to a dataset. I need to add columns based on user input which do not bind to a specific dataset. Its just additional information.

  • Re: Dynamic columns in repeater

    10-31-2008, 3:41 PM
    • Participant
      1,154 point Participant
    • jnsuryaprakash
    • Member since 10-14-2008, 4:45 PM
    • connecticut
    • Posts 232

    If you want to do it only through repeater only option i can think of is building the repeater code dynamically in the code behind and redering it on browser. There might be other ways i am not sure !!!!!

    If you would like to use datalist adding columns will be easy through Datalist.repeatcolumn property.

    Thanks,
    Surya Prakash Jayanti
    http://suryaprakashj.blogspot.com
    http://jnsuryaprakash.blogspot.com
    http://sqlserver-qa.net/blogs/dotnet_40/default.aspx

    p.s. Please click "Mark as Answer" if you think this post answered your question
Page 1 of 1 (4 items)