Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid row selection

Reply
Thread Tools

datagrid row selection

 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      08-24-2005
Hey all,

I have a datagrid that has a select column. I've bound an untyped data table
to the datagrid and was just wondering how I would get to all the values of a
row when a user selects a row?

Is there more than one way to do this?

thanks,
rodchar
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2FsdmluIEtE?=
Guest
Posts: n/a
 
      08-25-2005
Hi,
I have used the following method with my .Net version 1.1:
private void DataGrid1_ItemCommand(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
firstColVal = e.Item.Cells[0].Text;
secondColVal = en.Item.Cells[1].Text;
.....
}
}

If you have webcontrols such as dropdown list, radio buttons or check boxes
inside each of the rows and wish to retrieve the values for those, you'd need
to use the FindControl() function (I think).
Hope that helps.
Cheers,
Calvin
"rodchar" wrote:

> Hey all,
>
> I have a datagrid that has a select column. I've bound an untyped data table
> to the datagrid and was just wondering how I would get to all the values of a
> row when a user selects a row?
>
> Is there more than one way to do this?
>
> thanks,
> rodchar

 
Reply With Quote
 
 
 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      08-25-2005
thank you, this helped.

"Calvin KD" wrote:

> Hi,
> I have used the following method with my .Net version 1.1:
> private void DataGrid1_ItemCommand(object sender, DataGridItemEventArgs e)
> {
> if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
> ListItemType.AlternatingItem)
> {
> firstColVal = e.Item.Cells[0].Text;
> secondColVal = en.Item.Cells[1].Text;
> .....
> }
> }
>
> If you have webcontrols such as dropdown list, radio buttons or check boxes
> inside each of the rows and wish to retrieve the values for those, you'd need
> to use the FindControl() function (I think).
> Hope that helps.
> Cheers,
> Calvin
> "rodchar" wrote:
>
> > Hey all,
> >
> > I have a datagrid that has a select column. I've bound an untyped data table
> > to the datagrid and was just wondering how I would get to all the values of a
> > row when a user selects a row?
> >
> > Is there more than one way to do this?
> >
> > thanks,
> > rodchar

 
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
DataGrid Client Side row selection =?Utf-8?B?QmlkYXJrb3Rh?= ASP .Net 0 05-23-2005 10:38 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
JTable with row selection, but no cell selection Simon Niederberger Java 2 01-07-2005 04:17 PM
highlight datagrid row on radiobutton selection =?Utf-8?B?YmFjazJncmlk?= ASP .Net 0 09-13-2004 10:15 PM
Datagrid Row Selection Toby Riley ASP .Net Datagrid Control 1 10-08-2003 05:10 AM



Advertisments