Home All Groups Group Topic Archive Search About

Better tool for selection - Datagrid or DataList?

Author
20 Dec 2005 8:45 PM
jonefer
After the user searches and is presented with a list of results - which is
the better tool for clicking to get a "details" page...?

If it is the DataGrid, how do I recoginize selection? (Doesn't highlight
when clicked)

If it is the DataList, I'm having problems with the same record repeating
over and over again... instead of showing all the different records...

Author
21 Dec 2005 5:09 PM
Phillip Williams
Hi Jonefer,

The datagrid has 2 properties:
1-    SelectedIndex:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclassselectedindextopic.asp

2-    SelectedItemStyle:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclassselecteditemstyletopic.asp
And an event named SelectedIndexChanged: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsbasedatalistclassselectedindexchangedtopic.asp

If you use any combinations of those members you can select a row on datagrid.

You can also do that using Javascript on the client as in this demo:
http://www.societopia.net/samples/dataGrid_5c.aspx

The datalist too has similar properties and events as the datagrid.  I have
a sample using the datalist selectedIndex to highlight the select row:
http://www.societopia.net/Samples/DataList_Hierarchy.aspx
Show quoteHide quote
"jonefer" wrote:

>
> After the user searches and is presented with a list of results - which is
> the better tool for clicking to get a "details" page...?
>
> If it is the DataGrid, how do I recoginize selection? (Doesn't highlight
> when clicked)
>
> If it is the DataList, I'm having problems with the same record repeating
> over and over again... instead of showing all the different records...