C# – Why can’t GridView extract child control’s values directly

asp.netcdata-bindinggridview

using Bind in a GridView control template enables the control to extract values from child controls in the template and pass them to the data source control. The data source control in turn performs the appropriate command for the database. For this reason, the Bind function is used inside the EditItemTemplate or InsertItemTemplate of a data-bound control.

Why is Bind() needed to extract values and pass them to GridView. Why isn’t GridView able to extract child control’s values directly?

thanx

Best Answer

how can you extract values if they are yet not assigned ? you have to use Bind as mentioned so the values are retrieved from DB, then you use ItemDataBound event and findcontrol then extract it's value.

hope this helps.