Hi Kuuy,
Here is the C# version of your
VB.NET code:
partial class TestMenu3 : System.Web.UI.Page
{
protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
SqlDataSource ds = (SqlDataSource)e.Row.FindControl("SqlDataSource2") ;
ds.SelectParameters("fkMenuItemID").DefaultValue = GridView1.DataKeys(e.Row.RowIndex).Value;
}
}
}
By the way, this code snippet has some technical problems. For more information, please refer to the chapter of my book on data source controls and their interactions with data bound controls.
Cheers!
Shahram
-----------------------
Shahram Khosravi, Ph.D.
Author of Professional ASP.NET 2.0 Server Control and Component Development