Hi
I have below Data for Gridiew. After last columa Date i want to add Edit Image
DataTable BookPlanningResult = sQLUtility.GeBookPlanningRecommendation(vRpl, BookCollection, StudentCollection).Tables[0];
if (BookPlanningResult != null)
{
DataColumn Remarks = new DataColumn("Remarks", typeof(string));
BookPlanningResult.Columns.Add(Remarks);
DataColumn Dates = new DataColumn("Date", typeof(DateTime));
BookPlanningResult.Columns.Add(Dates);
grdPlanning.DataSource = BookPlanningResult;
grdPlanning.DataBind();
}
Thanks
Tuhin PaulPosted May 1, 2023, 6:42 PM
In the code behind, you can handle the click event of the Image control to perform the edit action
In the GridView, the BoundFields should be replaced with the actual column names from your DataTable, and the control IDs in row.FindControl should match the IDs of the controls in the ItemTemplate.
Tuhin PaulPosted May 1, 2023, 6:42 PM
To add an edit image after the last column in the GridView, you can use a TemplateField with an Image control that has a click event to handle the edit action.
Rajkiran SwainPosted Apr 29, 2023, 3:44 PM