Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What
happens is that I create this button in code, but then when I click him,
nothing happens.
I have this in my vb code:
---------------------------------
Dim bc As New ButtonColumn
bc.HeaderText = ""
bc.Text = "See Details"
bc.CommandName = "Select"
dgMyGrid.Columns.AddAt(0, bc)
//then I have the fucntion that should run when click in button
Sub SeeDetails(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)
If e.CommandName <> "Page" Then
'Place my code here
End If
End Sub
------------------------------------
In HTML have this:
------------------------------------
<asp:datagrid id="dgMyGrid" OnItemCommand="SeeDetails"
AutoGenerateColumns="False">
......
</asp:datagrid>
------------------------------------
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca 5 1267
Try to :
- add an ID to your button.
- move your code into the OnInit method.
"ruca" wrote: Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What happens is that I create this button in code, but then when I click him, nothing happens. I have this in my vb code: --------------------------------- Dim bc As New ButtonColumn bc.HeaderText = "" bc.Text = "See Details" bc.CommandName = "Select" dgMyGrid.Columns.AddAt(0, bc)
//then I have the fucntion that should run when click in button Sub SeeDetails(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)
If e.CommandName <> "Page" Then 'Place my code here End If
End Sub ------------------------------------
In HTML have this:
------------------------------------ <asp:datagrid id="dgMyGrid" OnItemCommand="SeeDetails" AutoGenerateColumns="False"> ...... </asp:datagrid> ------------------------------------
-- Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
Try to :
- add an ID to your button.
- move your code into the OnInit method.
"ruca" wrote: Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What happens is that I create this button in code, but then when I click him, nothing happens. I have this in my vb code: --------------------------------- Dim bc As New ButtonColumn bc.HeaderText = "" bc.Text = "See Details" bc.CommandName = "Select" dgMyGrid.Columns.AddAt(0, bc)
//then I have the fucntion that should run when click in button Sub SeeDetails(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)
If e.CommandName <> "Page" Then 'Place my code here End If
End Sub ------------------------------------
In HTML have this:
------------------------------------ <asp:datagrid id="dgMyGrid" OnItemCommand="SeeDetails" AutoGenerateColumns="False"> ...... </asp:datagrid> ------------------------------------
-- Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
Check out this article to know how to add columns dynamically to datagrid
Creating Datagrid Templated Columns Dynamically http://www.dotnetbips.com/displayarticle.aspx?id=84 http://www.dotnetbips.com/displayarticle.aspx?id=85
--
-Saravana http://dotnetjunkies.com/WebLog/saravana/ www.ExtremeExperts.com
"ruca" <ru***@iol.pt> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What happens is that I create this button in code, but then when I click him, nothing happens. I have this in my vb code: --------------------------------- Dim bc As New ButtonColumn bc.HeaderText = "" bc.Text = "See Details" bc.CommandName = "Select" dgMyGrid.Columns.AddAt(0, bc)
//then I have the fucntion that should run when click in button Sub SeeDetails(ByVal Sender As Object, ByVal e As
DataGridCommandEventArgs) If e.CommandName <> "Page" Then 'Place my code here End If
End Sub ------------------------------------
In HTML have this:
------------------------------------ <asp:datagrid id="dgMyGrid" OnItemCommand="SeeDetails" AutoGenerateColumns="False"> ...... </asp:datagrid> ------------------------------------
-- Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
Check out this article to know how to add columns dynamically to datagrid
Creating Datagrid Templated Columns Dynamically http://www.dotnetbips.com/displayarticle.aspx?id=84 http://www.dotnetbips.com/displayarticle.aspx?id=85
--
-Saravana http://dotnetjunkies.com/WebLog/saravana/ www.ExtremeExperts.com
"ruca" <ru***@iol.pt> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What happens is that I create this button in code, but then when I click him, nothing happens. I have this in my vb code: --------------------------------- Dim bc As New ButtonColumn bc.HeaderText = "" bc.Text = "See Details" bc.CommandName = "Select" dgMyGrid.Columns.AddAt(0, bc)
//then I have the fucntion that should run when click in button Sub SeeDetails(ByVal Sender As Object, ByVal e As
DataGridCommandEventArgs) If e.CommandName <> "Page" Then 'Place my code here End If
End Sub ------------------------------------
In HTML have this:
------------------------------------ <asp:datagrid id="dgMyGrid" OnItemCommand="SeeDetails" AutoGenerateColumns="False"> ...... </asp:datagrid> ------------------------------------
-- Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
This is ASP.NET and buttoncolumn don't have Id's.
And don't have OnInit method. Have Form_Load event.
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"Vko" <Vk*@discussions.microsoft.com> escreveu na mensagem
news:77**********************************@microsof t.com... Try to : - add an ID to your button. - move your code into the OnInit method.
"ruca" wrote:
Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What happens is that I create this button in code, but then when I click him, nothing happens. I have this in my vb code: --------------------------------- Dim bc As New ButtonColumn bc.HeaderText = "" bc.Text = "See Details" bc.CommandName = "Select" dgMyGrid.Columns.AddAt(0, bc)
//then I have the fucntion that should run when click in button Sub SeeDetails(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)
If e.CommandName <> "Page" Then 'Place my code here End If
End Sub ------------------------------------
In HTML have this:
------------------------------------ <asp:datagrid id="dgMyGrid" OnItemCommand="SeeDetails" AutoGenerateColumns="False"> ...... </asp:datagrid> ------------------------------------
-- Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kepes Krisztian |
last post by:
Hi !
My problem is that:
1.)
I want to create a frame with some buttons, and client area.
If the user clicked on a button, the procedure create components on
client area, and show results.
|
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...
|
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...
|
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...
|
by: ruca |
last post by:
Hi gurus,
I need to create a ButtonColumn in my code for using in my datagrig. What
happens is that I create this button in code, but then when I click him,
nothing happens.
I have this in my...
|
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...
|
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...
|
by: Cesar Ronchese |
last post by:
Hello.
I have a WebForm that contains a Panel object. This panel, at design time is
empty. When running, I need to create dinamically a Label and a WebControl
(built from the same project).
I...
|
by: basetta |
last post by:
Hi,
I need to know how I can use some objects create dinamically in vb.net form.
My code creates some buttons in my windows form, then I would like to manage their click events, but I don't know...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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,...
| |