Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a linkButton column in datagrid?

Status
Not open for further replies.

passs

Programmer
Dec 29, 2003
170
RU
Hello everybody!

I need to creat a table (using DataGrid) with linkButtons in it's columns. DataGrid gets information from DB:

SqlDataAdapter myData = new SqlDataAdapter("SELECT City, Product FROM City WHERE Year = " + year + " AND Month = '" + month.ToString() + "' AND Product = '" + product.ToString() + "' ORDER BY City", sqlConnection);
DataSet ds = new DataSet();
myData.Fill(ds);
dgCities.DataSource = ds.Tables[0].DefaultView;
dgCities.DataBind();

But i do not understand how to put in each cell linkbutton with .text = information from DB?

And another question. Am i able to create DataGrid which will be not only vertical but for example 5 columns with 10 strings in each column. I mean something like this:

Name Number | Name Number | Name Number
Alex 011 | Peter 023 | Jean 111
Alexey 012 | Robert 024 | Olga 131

Or i have to creat 5 DataGrids and bind data from DB to first from 1 to 10, to second from 11 to 20 i.e.?
Then:) one more question, how to show information in datagrid from 11 string to 20 if it has for example 50 strings?

I'll be very very very thankful for help!

Best regards!
Alexander
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top