Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
650
Double Columns when data is bound
posted

I created a basic page with a webgrid on it.  Created the four columns I care about (for now) 

Column1 | Column2 | Column3 | Column4

I then create my datatype with the information for the columns, set it to the datasource, and bind that to the grid.

Then when I run the app, I get double the columns,

Column1 | Column2 | Column3 | Column4|Column1 | Column2 | Column3 | Column4

All columns have the information from placed in the data type.  the datatype looks correct, Any idea what is going on here?

  • 45049
    Verified Answer
    posted

    The grid is automatically generating columns for you, above and beyond the columns you've manually defined. 

    Either set the DisplayLayout.AutoGenerateColumns property of your grid to false, or set the IsBound property of each of your manually-defined columns to true.

    Since you mention that you've "[c]reated the four columns [you] care about (for now)" I suspect that setting AutoGenerateColumns to false is likely what you're after.