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

ASP.Net Grid Control Link Button

In an ASP.NET page that has a data grid with a bound column of link button.
How can I reference the control and set properties for the link button at
run time?
Nov 18 '05 #1
1 1222
Hi Robin,

This is so simple!

foreach (DataGridItem item in dgCustomers.Items)
{
TableCell cell = item.Cells[0];
LinkButton button = (LinkButton) cell.Controls[0];
button.Text = "some text";
}
The above example assumes that your DataGrid is named dgCustomers and the LinkColumn is the first column in DataGrid. That's why I have written Items.Cells[0]. You can reference any columns using its index through Items.Cells[i].

The LinkButton has also other properties like NavigateUrl that you can set at run time.

Hope this helps! Please feel free to ask any questions if you are still confused with this.

Best Wishes,
Mosh

"Robin" <ro*******@hotmail.com> wrote in message news:up**************@tk2msftngp13.phx.gbl...
In an ASP.NET page that has a data grid with a bound column of link button.
How can I reference the control and set properties for the link button at
run time?

Nov 18 '05 #2

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

Similar topics

5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
13
by: John M | last post by:
Hello, In Visual studio .NET 2003, On datagrid object : How can I link the button element : edit, to do a some client events (such as message box, and do another event just after that to the...
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
6
by: GK | last post by:
I have an ASP.NET web application (version 1.1,VS 2003), running on Windows XP Professional, SP2. Many of the pages use ASP.NET Grid Control, with pagination. One of the columns of this Grid is a...
2
by: Smokey Grindle | last post by:
I have the following on my page... a link button that will send the command name "use" to the command handler and a grid view with the following columns 0 - Template column - just a checkbox...
1
by: sonali_aurangabadkar | last post by:
i want to edit whole grid on singel button click
1
by: =?Utf-8?B?TG95b2xhIHN0YWxpbg==?= | last post by:
Hi, I am using ASP.Net 2.0 version and Windows'XP OS. I am useing the Grid view control to display the user details along with the paging concept provided by the grid view control. When i...
6
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
2
by: skanemupp | last post by:
so my little calculator works perfectly now. just having some trouble with the layout. this whole tkinter-thing seems to be more tricky than it should be. how can i make the 4 column of buttons...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...
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: 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:
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 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.