473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Autogenerated Columns

I have a DG with autogenerated columns.
can i make a columns readonly like the data key column.
when edititemindex is valid.
Thanks
Nov 18 '05 #1
8 1824
In the <asp:boundcolumn> tag, put readonly="True"

Eg.

<asp:boundcolumn datafieldid="ID" headertext="ID" readonly="True" />

Hope this helps,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I have a DG with autogenerated columns.
can i make a columns readonly like the data key column.
when edititemindex is valid.
Thanks

Nov 18 '05 #2
appreciate your reply.
I do not have bound columns.
They are autogenerated.
thanks
-----Original Message-----
In the <asp:boundcolumn> tag, put readonly="True"

Eg.

<asp:boundcolumn datafieldid="ID" headertext="ID" readonly="True" />
Hope this helps,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in messagenews:00****************************@phx.gbl...
I have a DG with autogenerated columns.
can i make a columns readonly like the data key column.
when edititemindex is valid.
Thanks

.

Nov 18 '05 #3
You can still use this tag. It will override the autogenerated column. The
rest of the columns will still be automatically generated.

Eg.

<asp:datagrid id="DataGrid1" runat="server" width="100%" cellpadding="2"
autogeneratecolumns="True">
<columns>
<asp:boundcolumn datafield="ID" headertext="ID" readonly="True"/>
</columns>
</asp:datagrid>

Regards,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
appreciate your reply.
I do not have bound columns.
They are autogenerated.
thanks
-----Original Message-----
In the <asp:boundcolumn> tag, put readonly="True"

Eg.

<asp:boundcolumn datafieldid="ID" headertext="ID"

readonly="True" />

Hope this helps,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in

message
news:00****************************@phx.gbl...
I have a DG with autogenerated columns.
can i make a columns readonly like the data key column.
when edititemindex is valid.
Thanks

Nov 18 '05 #4
maybe just dont assign any event handler to edit event ... ?
Nov 18 '05 #5
Thanks. But i see the duplicate columns. since they are
autogenerated also. Is there a way i can avoid this.?
thanks
-----Original Message-----
You can still use this tag. It will override the autogenerated column. Therest of the columns will still be automatically generated.

Eg.

<asp:datagrid id="DataGrid1" runat="server" width="100%" cellpadding="2"autogeneratecolumns="True">
<columns>
<asp:boundcolumn datafield="ID" headertext="ID" readonly="True"/></columns>
</asp:datagrid>

Regards,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl...
appreciate your reply.
I do not have bound columns.
They are autogenerated.
thanks
>-----Original Message-----
>In the <asp:boundcolumn> tag, put readonly="True"
>
>Eg.
>
><asp:boundcolumn datafieldid="ID" headertext="ID"

readonly="True" />
>
>Hope this helps,
>
>Mun
>
>
>
>
>"Binny" <an*******@discussions.microsoft.com> wrote in

message
>news:00****************************@phx.gbl...
>> I have a DG with autogenerated columns.
>> can i make a columns readonly like the data key column. >> when edititemindex is valid.
>> Thanks

.

Nov 18 '05 #6
I've tried a few things, and there doesn't seem to be a way to do this. If
you want to make a column readonly, you have to define each column to be
bound using the <asp:boundcolumn> tag, and set the readonly attribute to
true for the column you want to be readonly.

Regards,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
Thanks. But i see the duplicate columns. since they are
autogenerated also. Is there a way i can avoid this.?
thanks
-----Original Message-----
You can still use this tag. It will override the

autogenerated column. The
rest of the columns will still be automatically generated.

Eg.

<asp:datagrid id="DataGrid1" runat="server" width="100%"

cellpadding="2"
autogeneratecolumns="True">
<columns>
<asp:boundcolumn datafield="ID" headertext="ID"

readonly="True"/>
</columns>
</asp:datagrid>

Regards,

Mun

Nov 18 '05 #7
Thanks for helping.
Finally,i figured out. To make this happen
we have to make the textboxes in the corresponding column
as read-only.
Thanks

-----Original Message-----
I've tried a few things, and there doesn't seem to be a way to do this. Ifyou want to make a column readonly, you have to define each column to bebound using the <asp:boundcolumn> tag, and set the readonly attribute totrue for the column you want to be readonly.

Regards,

Mun


"Binny" <an*******@discussions.microsoft.com> wrote in messagenews:09****************************@phx.gbl...
Thanks. But i see the duplicate columns. since they are
autogenerated also. Is there a way i can avoid this.?
thanks
>-----Original Message-----
>You can still use this tag. It will override the

autogenerated column. The
>rest of the columns will still be automatically generated. >
>Eg.
>
><asp:datagrid id="DataGrid1" runat="server"
width="100%" cellpadding="2"
>autogeneratecolumns="True">
><columns>
> <asp:boundcolumn datafield="ID" headertext="ID"

readonly="True"/>
></columns>
></asp:datagrid>
>
>Regards,
>
>Mun

.

Nov 18 '05 #8
Did you still use the autogenerate feature when doing this?

If possible, post code please. I'm interested to see how you done that.

Cheers,

Mun

"Binny" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Thanks for helping.
Finally,i figured out. To make this happen
we have to make the textboxes in the corresponding column
as read-only.
Thanks

Nov 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MS | last post by:
Hi, Is there a way to change the forecolor of autogenerated column headers in a datagrid with sorting enabled (I mean the hyperlinks which when clicked, sorts the grid) Thanks in advance
1
by: MS | last post by:
Hi, Is there a way to change the forecolor of autogenerated column headers in a datagrid with sorting enabled. If it is possible using CSS then where I need to write the code to change the color ...
3
by: Binny | last post by:
I have a DG with autogenerated columns. can i make a column readonly like the data key column. Thanks
0
by: Alvin Bruney [MVP] | last post by:
Anybody know of a link or resource to adding a control to an autogenerated datagrid when the edit button is clicked? I'm particularly not interested in adding template columns or setting...
2
by: jax | last post by:
Hi All developers ! I have a datagrid which autogenerates columns by the sql SELECT list... The list (for some reasons) must be the same. So my question is HOW TO MOVE OUT A COLUMN FROM...
0
by: Luis Esteban Valencia | last post by:
Once a user clicks "add new row", a new row is created in my Datagrid. The datasource is huge so they have to scroll to the bottom of the page to edit the data in the new row. I have come across...
9
by: Steve | last post by:
How I can remove an AutoGenerated column? I wnat to inlcude the primary key in the resultset for creating some custom LinkButtons, but I don't want it (the PK) displayed in the DataGrid. I tried...
2
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi I've just moved from asp.net 1.1 to 2.0 so am new to gridviews and have a problem. I've got a gridview on a form in a web layer project. It has an objectdatasource object which calls a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.