473,748 Members | 9,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I adress a ButtonColumn in ItemCreated?

Hey!

I have a ButtonColumn (PushButton) which I need to address in the DataGrid's
ItemCreated to be able to set the Text on the ButtonColumn (yes I need to
change this in runtime).

regards
/Lars Netzel
Nov 18 '05 #1
2 1176
Hi Lars,

in the ItemCreated signature you have the e argument;
It contains a reference to the created row.
if you use this sintax
e.Item.Cells
you have the collection of all cells in the grid row;
then if you want to look for a particular object in the row you have to use:

e.Item.Cells[cellnumber].FindControl("C ontrolName")

and then set the property.

HTH,
Stefano Mostarda MCP
Rome Italy
Lars Netzel wrote:
Hey!

I have a ButtonColumn (PushButton) which I need to address in the DataGrid's
ItemCreated to be able to set the Text on the ButtonColumn (yes I need to
change this in runtime).

regards
/Lars Netzel

Nov 18 '05 #2
I fixed it myself!

Dim myButton as e.Item.Cell(0). Control(0)
myButton.Text = "mytext"

/
Lars
Nov 18 '05 #3

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

Similar topics

4
3221
by: CGuy | last post by:
Hi, I have a datagrid that has one ButtonColumn which is bound to a database field. My requirement is that when the page containing the datagrid is loaded, I would like the ButtonColumn to be enabled/disabled based on the value of a boolean variable that is calculated at runtime - if the value if false, I don't want the ButtonColumn to display links for the displayed items.
3
2352
by: John | last post by:
The ItemCommand event not getting fired when I add both a BoundColumn and a ButtonColumn to a datagrid. When I add a ButtonColumn by itself, everything works fine, but as soon as I add a BoundColumn, the ItemCommand event doesn't seem to get called. I've been struggling with this for too long now, I'm certain there's something I'm not getting. Here's the relevant code. Thanks in advance! // As is, this code does not correctly call...
0
1234
by: BK Kim | last post by:
Hi. I am trying to use buttonColumn in the datagrid. My datagrid is binded to a datatable. And I am trying to get the text value from itemcreated or itemdatabound event in the datagrid. However, e.Item.Cells.Text is empty except for the header and footer.
6
4667
by: RSB | last post by:
Hi Everyone, i am using a ASP: DataGrid control in the page and for each row i have a Delete Button Column. Every thing works fine. But now i want to add a Java script confirmation check for the user that Delete has been selected and are they sure to continue. I have already used this Attributes.Add ( cmdDelete.Attributes.Add("onClick", "return confirmDelete();") )
6
3163
by: z. f. | last post by:
Hi, i have a datagrid with a delete button for each row in the grid. when the delete button is clicked i need to ask the user in a "confirm" message box if he's sure he wants to delete. the problem is that the <asp:ButtonColumn ButtonType="PushButton" CommandName="Delete" .... don't have a property to allow onclick to run client side script . how can this be,
9
2332
by: Manuel | last post by:
I have a Datagrid with 9 elements. The problem is that when I sort the grid by a column, it present more columns than there are. This is my code for the ItemCreated event: Private pNo As Integer = 0 Private Sub grd_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grd.ItemCreated
1
3399
by: Lenin Sakthees via .NET 247 | last post by:
Hi all, I am using a datagrid to show values from a SQL table. My problem is, I want to show the details of the each row when the user clicks the 'View details' buttoncolumn. I am able to fire a event when the user clicks the button column here is my html for the datagrid ************************************************************************************** <Columns> <asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="Title"...
1
1571
by: Sathyaish | last post by:
How do you get the text of a ButtonColumn control column in a datagrid? As an example, I tried this little snippet on a test project, but it returns a null string. Private Sub dg_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg.ItemCommand If Not e.Item Is Nothing Then lblMessage.Text = "You clicked " & e.Item.Cells(1).Text &
1
1702
by: nipe | last post by:
Hello, I'm having problem with my custom datagrid control can't fire itemcommand event. The fact is that I have to make fully cutom user control so I can't do any scripting to .aspx file. There are two classes that has something to do with this: datagrid class which has 2 buttoncolumns and panel class that HAS datagrid and handles itemcommand event. //datagrid class is like this
0
8991
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
8830
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
9541
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
9370
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
9247
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
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2782
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.