HighTechTalks DotNet Forums  

Select datagrid item programmatically in ASP.NET

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Select datagrid item programmatically in ASP.NET in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Joseph T.S.Lim
 
Posts: n/a

Default Select datagrid item programmatically in ASP.NET - 06-30-2003 , 10:29 PM






Hi all,

I have a question on ASP.NET Datagrid.
Here goes nothing :-

I have a datagrid with a SELECTCOMMAND on the first column.
Whenever i click on the first column, it will highlight the particular
item.
No problem with this. I want to know how do i select a datagrid
item when i click on a button without clicking on the datagrid item.

For example, when i click button A, the datagrid will select my desire
row item
highlight it. I want to achieve this on the Code behind, i don't want
to
use the __doPostBack("gridID:_ctl?_ctl?", ""). I able to select it via
the client script but i don't want.



Reply With Quote
  #2  
Old   
Teemu Keiski
 
Posts: n/a

Default Re: Select datagrid item programmatically in ASP.NET - 07-01-2003 , 01:52 PM






One way is just to set the DataGrid's SelectedIndex property as you wish.

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

Email:
joteke (AT) aspalliance (DOT) com

"Joseph T.S.Lim" <joseph_net (AT) hotmail (DOT) com> wrote

Quote:
Hi all,

I have a question on ASP.NET Datagrid.
Here goes nothing :-

I have a datagrid with a SELECTCOMMAND on the first column.
Whenever i click on the first column, it will highlight the particular
item.
No problem with this. I want to know how do i select a datagrid
item when i click on a button without clicking on the datagrid item.

For example, when i click button A, the datagrid will select my desire
row item
highlight it. I want to achieve this on the Code behind, i don't want
to
use the __doPostBack("gridID:_ctl?_ctl?", ""). I able to select it
via
the client script but i don't want.





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.