473,734 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating an EditCommandColu mn from code

Ian
Hi

I have used the following code to essentially late bind an EditCommandColu mn
to my datagrid in ASP.NET.

EditCommandColu mn ec = new EditCommandColu mn();
ec.ButtonType = ButtonColumnTyp e.PushButton;
ec.CancelText = "Cancel";
ec.EditText = "Edit";
ec.HeaderText = "Rename";
ec.UpdateText = "Update";
ec.CausesValida tion = true;
dtgResults.Colu mns.Add(ec);
ec = null;

However, the edit command that affects the grid in respect of changing
labels to textboxes does not fire even though I have set the datagrid to have
an OnUpdateCommand as follows

<asp:DataGrid id=dtgResults runat="server" AllowSorting="T rue"
OnDeleteCommand ="DataDelete "
OnCancelCommand ="DataCancel " OnEditCommand=" DataEdit"
OnUpdateCommand ="DataUpdate "
AllowPaging="Tr ue" PageSize="10" CellPadding="3"
BackColor="Whit e"
BorderWidth="1p x" AutoGenerateCol umns="False"
AllowCustomPagi ng="false"
PagerStyle-Visible="false" >

<FooterStyle CssClass="GridF ooter" />
<SelectedItemSt yle CssClass="GridI tem" />
<ItemStyle CssClass="GridI tem" />
<HeaderStyle CssClass="GridH eader" />
<AlternatingIte mStyle CssClass="GridA lternateItem" />
</asp:DataGrid>

FYI, if i use the class method of creating the EditCommandColu mn in the HTML
page, everything works fine

Any help would be appreciated
Ian
Nov 21 '06 #1
0 1030

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

Similar topics

18
1446
by: Stanley J Mroczek | last post by:
I Set the EditCommandColumn to Visible=False to stop people who are not allowed to make any changes to a record. How can set it to Visible=true for some users? Please answer in VB Thanks Stan
4
2565
by: RobS | last post by:
Can anyone answer this question: How can I disable validation when edit column update button is pressed. Can it be done for the whole grid? Regards, Robert
1
4334
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls):
1
1712
by: George Durzi | last post by:
I have an editcommandcolumn in my datagrid, as follows. <asp:editcommandcolumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"> I'd like to set the CausesValidation property of the Update portion to false. Can't seem to get it to work. The Edit and Cancel linkbuttons have CausesValidation turned off by default. That cell in that row of my datagrid is being rendered in my trace, as follows
1
1807
by: angus | last post by:
Dear All, I am using VB.net It is found that the <asp:EditCommandColumn/> wouldn't fired an event for OnEditCommand If pushbutton has been used: that is:
6
3344
by: Scott McDaniel | last post by:
I'm using Visual Studio 2005 with the .NET 2.0.50727 framework, and we're using the standard Datagrid control bound to a SQL Server. We have two groups of users - "full edit" users, and "view only" users. We would like to disable the EditCommandColumn of our Datagrid (named dgCertificates) for viewonly users. The intent is that viewonly would, obviously, only be able to view data and not maniupulate it in any way. I've tried the...
0
1240
by: slemen | last post by:
Hi, The DataGrid aps:EditCommandColumn when used with column templates created programmatically does not trigger the _Edit subroutine in code. The ASP:Datagrid definition is below (1), the _Edit subroutine signature (2) is below that and the column template class is (3). Thank you for your help, Scott
0
1309
by: slemen | last post by:
Hi, The asp:EditCommandColumn template does not fire the _edit sutboutine when the edit command column buttons are clicked. I get a Page Cannot Be Displayed page error instead. My (ASP 1.1) datagrid is defined in the HTML and the HTML <columns> has one defined template column and it is an asp:EditCommandColumn (with edit buttons). The datagrid's other columns are added at runtime by using the technique documented in the MSDN article:
0
1278
by: RN1 | last post by:
A Form has a few fields along with a Submit button & a DataGrid. The fields & the Submit Button are encapsulated in a Panel named pnlDataEntry & the DataGrid is encapsulated in a Panel named pnlShowData. There is also a Session variable which comes from the login page. If the user logs in as admin, then the session variable is 1 else 0. This is the code: --------------------------------- Sub Page_Load(ByVal obj As Object, ByVal ea As...
0
8776
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
9449
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
9310
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...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
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
8186
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...
0
6031
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();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.