Thanks, it was a very helpful piece of code!

--- In [email protected], "jmplun" <[EMAIL PROTECTED]>
wrote:
> How about 
> Private function selectItem(byval myID as integer) as boolean
> Dim iCount as integer
> Icount =0
> While icount < DataGrid.items.count
>    if datagrid.DataKeys(iCount) = myID then
>       datagrid.selectedindex = icount
>       return true
>    end if
>    iCount = icount +1
> End while
> Return false
> 
> End function
> 
> Jarrad
> 
> -----Original Message-----
> From: Aemca [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 27, 2004 7:17 AM
> To: [email protected]
> Subject: Re: [AspNetAnyQuestionIsOk] Datagrid selecting question
> 
> 
> Hmm looks good but i want it the other way around. 
> 
> I have an ID and want to make a datagrid item selected.
> 
> This gets me the id from the row where a button is pressed.
> 
> 
> ----- Original Message ----- 
> From: "Chak" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Thursday, February 26, 2004 6:44 PM
> Subject: Re: [AspNetAnyQuestionIsOk] Datagrid selecting question
> 
> 
> > http://www.superexpert.com/default.aspx?id=309
> > 
> > The above example uses the 'DataKeyField' attribute of
> > the datagrid , and in the 'OnItemcommand' event, it
> > retrieves the primary key of the selected row.
> > 
> > 
> > --- Aemca <[EMAIL PROTECTED]> wrote:
> > > I want to select a row in a datagrid based on a
> > > value in a datakey of this
> > > table.
> > > What is the easiest way to do this ?
> > > 
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Get better spam protection with Yahoo! Mail. 
> > http://antispam.yahoo.com/tools
> > 
> > 
> > 
> > 
> >  
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> 
> 
> 
>  
> Yahoo! Groups Links








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to