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

Gridview RowCreated - way to change just first row command text?

K B
Hi,

Is there a way to change the EditText value on just the commandfield in
the first row. In the RowCreated event...

If e.Row.RowIndex = 0 Then
...change the edittext on the commandfield

Thanks,
Kit
*** Sent via Developersdex http://www.developersdex.com ***
Jun 6 '06 #1
1 2810
On Tue, 06 Jun 2006 08:38:05 -0700, K B <ka**********@comcast.net>
wrote:
Hi,

Is there a way to change the EditText value on just the commandfield in
the first row. In the RowCreated event...

If e.Row.RowIndex = 0 Then
...change the edittext on the commandfield

Thanks,
Kit
*** Sent via Developersdex http://www.developersdex.com ***


Make sure you change the command row to a template first. Then this
code will do the trick:
protected void GridView1_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{

if (e.Row.RowIndex == 0)
{
LinkButton lb = (LinkButton)
e.Row.FindControl("LinkButton1");
lb.Text = "newtextbutton";
}
}
}
Peter Kellner

(posted the wrong post a minute ago)
Peter Kellner
http://peterkellner.net
Jun 6 '06 #2

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

Similar topics

5
by: Steve Bugden | last post by:
Hi, I would like to set the column widths in the ASP.NET GridView control at runtime I have tried the following: http://msdn2.microsoft.com/en-us/library/ms178296.aspx Which uses the...
10
by: NH | last post by:
I have a girdview with paging enabled. How can I add a message in the footer to say "Viewing records 1-15 of 45" etc Thanks
5
by: maurban | last post by:
Hi there experts, I have a gridview with a couple textboxes and a dropdownlist. I'm trying to insert a default value into my database driven dropdownlist. I'm doing this in the rowdatabound...
4
by: chris | last post by:
I have a perent gridview which includes in a template field a child gridview. Child gridview includes command buttons for opening different windows based on its row selected. I used the code...
4
by: =?Utf-8?B?Y2hyaXM=?= | last post by:
I have a perent gridview which includes in a template field a child gridview. Child gridview includes command buttons for opening different windows based on its row selected. I used the code...
1
by: Evan M. | last post by:
Here's my GridView and my SqlDataSource <asp:GridView ID="ContactHistoryGrid" runat="server" AutoGenerateColumns="False" DataSourceID="ContactHistoryDS" DataKeyNames="JobHistoryID"...
3
by: =?Utf-8?B?SmVu?= | last post by:
I would like to set the width on 2 columns of a asp.net gridview control, but I'm having trouble making this work. Here is the code I use to create the gridview: 'Create a new data table...
4
by: Yin99 | last post by:
I have a Gridview binding to a DataTable source. I'd like to set the column with of the second column. I cannot do this apparently because when AutoGenerateColumns=true, they do not appear in the...
0
by: =?Utf-8?B?YmVuamk=?= | last post by:
Hi, I've got a gridview that I bind programmatically to a view of a typed dataset. One column has a command button, and in the RowCreated event, I test to see if it's a DataRow, and if it is, I...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
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...
0
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...
0
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...
0
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,...

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.