471,348 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Data Grid displaying columns TWICE!

Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
....i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud
Jul 21 '05 #1
3 1796
Did you add columns to your datagrid (like template columns or button
columns) etc and define what fields in the table to use for these columns?

If you answered yes above check the property on the datagrid called
AutoGenerateColumns -- it is set to true by default. If it is set to true
set it to false

Corey

Setting it to

"pmud" wrote:
Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
...i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud

Jul 21 '05 #2
hi....

set the "AutoGenerateColumns" property of the datagrid to false.

regds
Kannan.V

"pmud" wrote:
Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
...i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud

Jul 21 '05 #3
ya that was what my prob was...

Thanks :))
"CoreyMas" wrote:
Did you add columns to your datagrid (like template columns or button
columns) etc and define what fields in the table to use for these columns?

If you answered yes above check the property on the datagrid called
AutoGenerateColumns -- it is set to true by default. If it is set to true
set it to false

Corey

Setting it to

"pmud" wrote:
Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
...i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Shane | last post: by
2 posts views Thread by Les | last post: by
5 posts views Thread by Tim | last post: by
3 posts views Thread by pmud | last post: by
9 posts views Thread by Anil Gupte | last post: by
6 posts views Thread by slinky | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.