Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataGrid in c#

Reply
Thread Tools

DataGrid in c#

 
 
=?Utf-8?B?QW50b1M=?=
Guest
Posts: n/a
 
      03-14-2005
I got a DataGrid on my webpage and I populate it by a query on the database
and after I make a DataBind method.

The Porblem is that I want some field to be clickable and of course I would
like it to send me an ID that I take from the Database.

That's my code:

-In .aspx page:
<aspataGrid id="dglista" runat="server"></aspataGrid>

-in .aspx.cs page (the codebehind page):

DataGrid dglista;
// after the query...
dglista.DatSource = ..dataset.Tables["tblista"];
dglista.DataBind();

How can I have a field where I can Click?

The page is a list where I should be able to select an item(row).

Thanks


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      03-14-2005
Hi AntoS:

Have you looked at HyperLinkColumn class?

http://msdn.microsoft.com/library/de...classtopic.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 14 Mar 2005 02:03:07 -0800, "AntoS"
<> wrote:

>I got a DataGrid on my webpage and I populate it by a query on the database
>and after I make a DataBind method.
>
>The Porblem is that I want some field to be clickable and of course I would
>like it to send me an ID that I take from the Database.
>
>That's my code:
>
>-In .aspx page:
><aspataGrid id="dglista" runat="server"></aspataGrid>
>
>-in .aspx.cs page (the codebehind page):
>
>DataGrid dglista;
>// after the query...
>dglista.DatSource = ..dataset.Tables["tblista"];
>dglista.DataBind();
>
>How can I have a field where I can Click?
>
>The page is a list where I should be able to select an item(row).
>
>Thanks
>


 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      03-14-2005
Hi AntoS,

You can think about using ButtonColumn
(ButtonType=LinkButton, DataTextField = DataField).

HTH

Elton Wang



>-----Original Message-----
>I got a DataGrid on my webpage and I populate it by a

query on the database
>and after I make a DataBind method.
>
>The Porblem is that I want some field to be clickable and

of course I would
>like it to send me an ID that I take from the Database.
>
>That's my code:
>
>-In .aspx page:
><aspataGrid id="dglista" runat="server"></aspataGrid>
>
>-in .aspx.cs page (the codebehind page):
>
>DataGrid dglista;
>// after the query...
>dglista.DatSource = ..dataset.Tables["tblista"];
>dglista.DataBind();
>
>How can I have a field where I can Click?
>
>The page is a list where I should be able to select an

item(row).
>
>Thanks
>
>
>.
>

 
Reply With Quote
 
JiangZemin
Guest
Posts: n/a
 
      03-15-2005
Hi,
the ASPNET quickstart tutorials at www.asp.net have great simple examples
how to do this. look under "web controls syntax reference", section
"datagrid".

HTH,
Premier JiangZemin, MCSD.NET

"AntoS" <> wrote in message
news:0C8531A1-710C-432B-BB6E-...
>I got a DataGrid on my webpage and I populate it by a query on the database
> and after I make a DataBind method.
>
> The Porblem is that I want some field to be clickable and of course I
> would
> like it to send me an ID that I take from the Database.
>
> That's my code:
>
> -In .aspx page:
> <aspataGrid id="dglista" runat="server"></aspataGrid>
>
> -in .aspx.cs page (the codebehind page):
>
> DataGrid dglista;
> // after the query...
> dglista.DatSource = ..dataset.Tables["tblista"];
> dglista.DataBind();
>
> How can I have a field where I can Click?
>
> The page is a list where I should be able to select an item(row).
>
> Thanks
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57