You seem to be databinding declaratively with DataSourceID property. In this
case actual select operation takes place in the PreRender event which fires
well after all your RowDataBound events. You need to databind in the
RowDataBound event itself. Simply databind with the DataSource property
instead of DataSourceID and call myDdl.DataBind() method.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Paul" <> wrote in message
news:BC1A5F25-14C1-4224-A0C7-...
>I have a gridview and in the RowDataBound I have the line of code below. I
> have the ObjDtaSce= to the datasource of a dropdown box. I have 3 rows
> that
> are populated and for some reason the dropdown box for all rows is
> populated
> by values expected in the last row only. I checked the ID value and it is
> correct for each row. Is there something I would need to reset?
>
> protected void gridview_RowDataBound(object sender, GridViewRowEventArgs
> e)
> '''
> '''
>
> ObjDtaSce.SelectParameters["ID"].DefaultValue =Convert.ToString
> (integervariable);//
> thanks.
>
> --
> Paul G
> Software engineer.