I am new to asp.net and want to know that does setting DataKeyNames property make sense when dynamically binding data? I have bind data using following code
gvCategory.DataSource = objCategoryInfo;
gvCategory.DataBind();
here gvCategory is my gridview that I created at designview and objCategoryInfo is my datasource. Is it necessay to set DataKeyNames property at design time.?
Thanks in advance.
Only if you want the automatic update or delete feature to work with GridView
GridView.DataKeyNames Property – MSDN