Dave
Dave

Reputation: 5624

How to Decide Whether To DataBind a Control or Not?

What are some good guidelines to follow when deciding whether or not to databind a control (for example, bind a combobox to a List)?

Are there situations where you should always or never databind a combobox?

How do you decide?

Upvotes: 1

Views: 100

Answers (2)

madcolor
madcolor

Reputation: 8170

I measure it by how much manipulation of the data and its presentation I will be doing.

If it's light manipulation I'll just bind it, or at most do OnRowDataBound.

If I'm extensivelty maipulating the data, I'll spit it to a DataTable, manipulate it and Databind.

I always eventually databind() however.

Upvotes: 1

Russ Cam
Russ Cam

Reputation: 125488

Usually, if the data already exists in a datasource somewhere and that data has the potential to be kept up to date for the application's uses (through the application itself or by other systems/processes), I'll databind the control to that datasource.

Upvotes: 1

Related Questions