473,473 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

grid with new link using C#

115 New Member
Hi

i have one doubt abt datagrid (using c#). pls help me

here is my code

//** code start here**

Page_Load event:

DataSet ds = BuildDataSet();
DataGrid1.DataSource = ds;
DataGrid1.DataBind();

private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
new DataColumn("ID",Type.GetType("System.Int32")); dt.Columns.Add(dc); dc = new DataColumn("Name",Type.GetType("System.String"));
dt.Columns.Add(dc); dc = new DataColumn("Date",Type.GetType("System.DateTime")) ; dt.Columns.Add(dc); // Fill the table with sample data
for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
dr["Date"] = DateTime.Now.AddSeconds(i * 10); dt.Rows.Add(dr); } // Return the dataset to the caller ret.Tables.Add(dt);
return ret;}
//**** code end here**
here i have add one more column with link . how can i add?

pls help me. pls send code immd
am waiting for ur reply
i want to be utput looks like this

ID Name Date URL
1 John Smith 1/1/2007 Hyper Link

2 John Smith 2/2/2007 Hyper Link
Apr 25 '07 #1
6 1322
yogarajan
115 New Member
Hi Mercie

i have one doubt abt datagrid (using c#). pls help me

here is my code

//** code start here**

Page_Load event:

DataSet ds = BuildDataSet();
DataGrid1.DataSource = ds;
DataGrid1.DataBind();

private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
new DataColumn("ID",Type.GetType("System.Int32")); dt.Columns.Add(dc); dc = new DataColumn("Name",Type.GetType("System.String"));
dt.Columns.Add(dc); dc = new DataColumn("Date",Type.GetType("System.DateTime")) ; dt.Columns.Add(dc); // Fill the table with sample data
for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
dr["Date"] = DateTime.Now.AddSeconds(i * 10); dt.Rows.Add(dr); } // Return the dataset to the caller ret.Tables.Add(dt);
return ret;}
//**** code end here**
here i have add one more column with link . how can i add?

pls help me. pls send code immd
am waiting for ur reply
i want to be utput looks like this

ID Name Date URL
1 John Smith 1/1/2007 Hyper Link

2 John Smith 2/2/2007 Hyper Link
Apr 25 '07 #2
yogarajan
115 New Member
Hi
i have one doubt abt datagrid (using c#). pls help me

here is my code

//** code start here**

Page_Load event:

DataSet ds = BuildDataSet();
DataGrid1.DataSource = ds;
DataGrid1.DataBind();

private DataSet BuildDataSet(){ DataSet ret = new DataSet(); DataTable dt =
new DataTable(); DataRow dr = null; // Define table column names and datatypes DataColumn dc =
new DataColumn("ID",Type.GetType("System.Int32")); dt.Columns.Add(dc); dc = new DataColumn("Name",Type.GetType("System.String"));
dt.Columns.Add(dc); dc = new DataColumn("Date",Type.GetType("System.DateTime")) ; dt.Columns.Add(dc); // Fill the table with sample data
for(int i = 1;i < = 10;i++) { dr = dt.NewRow(); dr["ID"] = i; dr["Name"] = "John Smith";
dr["Date"] = DateTime.Now.AddSeconds(i * 10); dt.Rows.Add(dr); } // Return the dataset to the caller ret.Tables.Add(dt);
return ret;}
//**** code end here**
here i have add one more column with link . how can i add?

pls help me. pls send code immd
am waiting for ur reply
i want to be utput looks like this

ID Name Date URL
1 John Smith 1/1/2007 Hyper Link

2 John Smith 2/2/2007 Hyper Link
Apr 25 '07 #3
Motoma
3,237 Recognized Expert Specialist
Please do not double (triple) post!
Apr 25 '07 #4
nmsreddi
366 Contributor
Hello

If you want to add some special columns like button or link in datagrid you have to use template column for that,you can edit that template column and you can place any control as for your need,

try it out....
Apr 26 '07 #5
yogarajan
115 New Member
how ?

pls give me some samples.

i am add link colum through programmatically

pls do it needful
Apr 26 '07 #6
yogarajan
115 New Member
Sir
please help me
please give me some samples
it is very urgent
May 2 '07 #7

Sign in to post your reply or Sign up for a free account.

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...
3
by: SAM | last post by:
Hey guys, Long time Access programmer, but never had to bother with these things until now. First, I use ADO all the time in VB, but now I need to use it in Access 2K. I never remember/know...
1
by: krian | last post by:
Hi, I need a help from anybody. My problem is here I wrote two WebApplication in ASP.net Using C#. The name of the applications are (Journal.aspx and Payment.aspx). These Two pages have DataGrids...
4
by: blackhawk | last post by:
I need to build a web page that has to potentially display a large amount of data in two grids on the same page. The HTML file with all of the formatting is about 7MB in size. This is too large...
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...
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...
2
by: Valli | last post by:
Hi, I am using a gridview to display data from table. In the gridview, there are 5 columns in which one column contains link name(eg. http://www.msn.com). I want to show this link as an...
2
by: firstexact | last post by:
Hi guys, First post, hope you can help, I have done two sites www.trisant.co.uk and my own www.firstexact.co.uk. The 2 x 2 grid I originally envisaged goes haywire in Firefox as I get a 4 high by...
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,...
1
by: rogerford | last post by:
I have a grid which i bind with values from Database. I have events to edit and update the grid. I am not using SqlDatasource to connect to DB. Rather i am doing the updating of the grid...
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
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
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.