473,796 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1840
In the <asp:boundcolum n> tag, put readonly="True"

Eg.

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

Hope this helps,

Mun


"Binny" <an*******@disc ussions.microso ft.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:boundcolum n> tag, put readonly="True"

Eg.

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

Mun


"Binny" <an*******@disc ussions.microso ft.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"
autogeneratecol umns="True">
<columns>
<asp:boundcolum n datafield="ID" headertext="ID" readonly="True"/>
</columns>
</asp:datagrid>

Regards,

Mun


"Binny" <an*******@disc ussions.microso ft.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:boundcolum n> tag, put readonly="True"

Eg.

<asp:boundcolu mn datafieldid="ID " headertext="ID"

readonly="True" />

Hope this helps,

Mun


"Binny" <an*******@disc ussions.microso ft.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:datagri d id="DataGrid1" runat="server" width="100%" cellpadding="2"autogenerateco lumns="True">
<columns>
<asp:boundcolum n datafield="ID" headertext="ID" readonly="True"/></columns>
</asp:datagrid>

Regards,

Mun


"Binny" <an*******@disc ussions.microso ft.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:boundcolum n> tag, put readonly="True"
>
>Eg.
>
><asp:boundcolu mn datafieldid="ID " headertext="ID"

readonly="True" />
>
>Hope this helps,
>
>Mun
>
>
>
>
>"Binny" <an*******@disc ussions.microso ft.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:boundcolum n> tag, and set the readonly attribute to
true for the column you want to be readonly.

Regards,

Mun


"Binny" <an*******@disc ussions.microso ft.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:datagri d id="DataGrid1" runat="server" width="100%"

cellpadding="2"
autogenerateco lumns="True">
<columns>
<asp:boundcolum n 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:boundcolum n> tag, and set the readonly attribute totrue for the column you want to be readonly.

Regards,

Mun


"Binny" <an*******@disc ussions.microso ft.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:datagri d id="DataGrid1" runat="server"
width="100%" cellpadding="2"
>autogenerateco lumns="True">
><columns>
> <asp:boundcolum n 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*******@disc ussions.microso ft.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
1458
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
1581
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 Thanks in advance
3
1440
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
1082
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 autogenerated to false. So for example, i'd like to be able to add a dropdown instead of the regular text box to any dynamic column in the grid when it is in edit mode. -- Regards,
2
403
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 AUTOGENERATED DATAGRID? I would really appreciated answer with some code ! :))
0
1747
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 two EE solutions which use javascript to focus on the textbox in the "editcommandcolumn" mode. However, these solutions were made for non-autogenerated columns. I NEED autogenerated columns for my project. Is it possible to give focus to a...
9
6108
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 searching the columnheader text, but found that AutoGenerated columns are members of the Columns collection. From the msdn documentation: Note: When the AutoGenerateColumns property is set to true, the columns created by the DataGrid control are...
2
2821
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 method in a class in a seperate data layer project.Therefore the columns are autogenerated. The problem I've got is that the data that fills the gridview has an "id" column which I don't want to display but I do want to use programmatically. I've...
0
9683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.