473,388 Members | 1,330 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,388 software developers and data experts.

Help on LinkButton vs PushButton ??

Dear all,

If I used the following code on a datagrid object

<Columns>
<asp:ButtonColumn Text="Events" ButtonType=LinkButton
CommandName="ShowEvent">
</asp:ButtonColumn>
</Columns>

then the datagrid_ItemCommand event is fired but when I replace the Button
type to be PushButton instead, then it is not fired anymore

What is the difference between those 2 button type?
Which event fired when clicking on the PushButton type ?

regards
serge
Jan 13 '06 #1
1 1644
Serge,

The button column is built in to use command events which are triggered
automatically. The push button operates in much the same way, but it won't
automatically have an event associated with it from within the datagrid. If
you want to use a button from within the grid you should set which
subroutine you want it to run by specifying the subroutine's name with the
button's "OnClick" property.

<asp:Button Text="Events" Id="MyButton" Runat="server"
OnClick="YourSubroutineNameHere"></Button>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:E7**********************************@microsof t.com...
Dear all,

If I used the following code on a datagrid object

<Columns>
<asp:ButtonColumn Text="Events" ButtonType=LinkButton
CommandName="ShowEvent">
</asp:ButtonColumn>
</Columns>

then the datagrid_ItemCommand event is fired but when I replace the Button
type to be PushButton instead, then it is not fired anymore

What is the difference between those 2 button type?
Which event fired when clicking on the PushButton type ?

regards
serge

Jan 13 '06 #2

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

Similar topics

1
by: Mark | last post by:
I have two buttons in a DataGrid. If I leave the ButtonType = "LinkButton", the EditCommand and DeleteCommand events fire fine. If I change th ButtonType = "PushButton", the events do not fire. ...
2
by: News | last post by:
Hi, I need help with datalist and linkbutton. I need a LinkButton to display in datalist if datafield "is_measure_customchecklist" in a db table set to true. Here is the code (in parts): ...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
3
by: KatB | last post by:
Hi, I'm building a datagrid with a column to show + or - signs for expanding/collapsing child rows, etc. It works okay except since I'm using a LinkButton column there is an underline below the...
6
by: Tim Meagher | last post by:
Can anyone help me figure out how to apply a stylesheet to a pushbutton defined in the asp:BoundColumn or asp:EditCommandColumn elements of a datagrid?
4
by: News | last post by:
Hi, I need help with datalist and linkbutton. I need a LinkButton to be visible in datalist only on the condition when datafield "is_measure_customchecklist" in a db table set to true. Here...
0
by: BrianDH | last post by:
Hi I have a web form with a Datagrid. Within the data grid I have a button. If the button is of type "Linkbutton" my VB code-behind will catch the users "click" However, if it is set to...
0
by: Sam | last post by:
Folks.. I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data...
2
by: tshad | last post by:
I have a DataGrid: <asp:datagrid id="articleList" runat="server" OnDeleteCommand="articleList_DeleteFile" OnItemDataBound="articleList_ItemDataBound" DataKeyField="FullName"...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.