GridView - set selected index by searching through data keys

Posted by Cristian Boariu on Stack Overflow See other posts from Stack Overflow or by Cristian Boariu
Published on 2010-03-17T21:30:40Z Indexed on 2010/03/17 21:31 UTC
Read the original article Hit count: 225

Filed under:
|

Hi,

I have a GridView which has DataKey[0] as productId. If i have for instance productId = 54, is there any way to search through all GridView item and set as selected the one who has DataKEy[0] = 54?

In drop down list i have :

ddlProducts.Items.FindByValue(lblProduct.Text.ToString())).Selected = true

Is anything similar for GridView?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#