Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:26:19+00:00 2026-06-02T16:26:19+00:00

I am using a DataList to render some divs in table layout and RepeatColumn

  • 0

I am using a DataList to render some divs in table layout and RepeatColumn property set to 3.
when my datasource has 3 or more than 3 records it works correctly and renders 3 columns and as many required rows.
But when my datasource contains one or two records it renders only one or two columns respectively, so violating standard of site.
Is there any way of padding so that if my datasource contains one record then other two columns will be generated automatically(of-course empty) or if datasource contains two records then third column will be generated automatically.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:26:21+00:00Added an answer on June 2, 2026 at 4:26 pm

    Just make sure you always have at least three items in your datasource before you bind it.

    Some psuedo-code should suffice:

    datasource = GetDatasourceMethod();
    while(datasource.Count <= 3) {
        datasource.Add(emptyItem);
    }
    datalist.DataSource = dataSource;
    datalist.DataBind();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to set the RepeatColumns property of an ASP.Net Datalist using
I am using jqGrid to render some data. Now I want the ability to
I'm using an XML based .config file for storing some records. My XML is
Using PHP, I can convert MySQL data or static table data to csv, Excel,
I am using datalist to display data from the database,I have got three fields
In my asp.net I am using Datalist in that I want to limit row
I am trying to make a grid of thumbnails using a datalist. I have
How to get clientID of Datalist control using jquery , I tried using the
I have build a web application which shows the list of customers using datalist
I'm using a datalist control. How I can add a row separator in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.