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 6006785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:35:22+00:00 2026-05-23T01:35:22+00:00

I have a gridview that contains around 16 ItemTemplate columns. The values in each

  • 0

I have a gridview that contains around 16 ItemTemplate columns. The values in each column are decimal properties. In each column, I’m doing some conditional logic to display N/A or actual value etc, etc. Something like,

<asp:TemplateField HeaderText="Test" ItemStyle-CssClass="test">                   
    <ItemTemplate>
            <%# Eval("TestExpense", "{0:n}").ToString() == "-1.00" ? "N/A" : "$" + Eval("TestExpense", "{0:n}")%> 
    </ItemTemplate>
</asp:TemplateField>

The grid returns many rows, say 30,000 in most cases. There is paging for the grid so only 10 rows are visible at a time. (Yes, I do bring all rows from the db back, no paging in SQL. The search is complicated and takes time)

The question is, should I do this logic in the RowDataBound Event where I can say do this logic only when the row is visible. This makes sure that only 10 visible rows (for the active page) are processed with this logic at a time. If I do a regular databind, is the datagrid smart enough to do the ItemTemplate logic only for 10 rows or does it do for all 30,000 rows. That will be unnecessary.

To add to this question, I have some Template columns that are derived from other properties. If I do a regular databind, does the grid calculate through all the columns for each row or only does it for the visible rows.

I believe if I use the RowDataBound event, I can control all this. But the other option is more convenient. If the gridview automatically does this, then I don’t have to worry about it. Any thoughts?

  • 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-05-23T01:35:23+00:00Added an answer on May 23, 2026 at 1:35 am

    RowDataBound and the inline code in the template field is only executed for the active page (10 rows in your case)

    If your not doing anything to complex I see no problem keeping it as inline code in template field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView A that have many columns, one of those contains price
I have a GridView. My GridView has a column that is contains an Options
I have a GridView that allows editing the values in every column, in every
I have a datalist that contains a gridview inside its itemtemplate. on the item-data_bound
I have a gridview (gdvMyInfo) that contains q column of links I have grabbing
I have a gridview that contains a column name History which has Plus (+)
I have a gridview that contains one linkbutton within itemtemplate. I bind this gridview
I have ModalPopupExtender that contains a UserControl that basically consists of a GridView and
I have a form that contains a GridView control which is databound to an
I have a user control that contains a GridView. The GridView has both a

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.