Get datakey from gridview rowupdating
Get datakey from gridview rowupdating - Sex randam chat date
The visitors to a web site can typically be divided into two groups: the users and the administrators.In data driven web sites, users are normally allowed to view data and administrators are allowed to add, edit or delete data.
Each template columns Item Template field contains Label Control & Edit Template contains Text Box control for Editing item.Set the Binding Field name to the Text Property of both controls for each template field to the respective Database Column Name i.e Eval(“Emp Name”).Set the Data Key Names property of Grid View to Primary Key Column of Data Base i.e. This property binds the database column field value to each row of gridview as a Unique Identifier.Assumptions- We are using SQL Server Express editions as Database.Table Name- Employees Fields- Emp Id, Emp Name, Designation Take Grid View control on page and set the ID property to dg Employees.Go to property builder by right click on Grid View - Edit Columns.
Uncheck Auto-Generate Field from the Property window.To do this we first need to obtain the reference of the current row by using its index no as shown in the first line below.By using the Grid View Row object we can find the reference of any control in the row in which user is editing the data. Major concern with any data entry form is Add, Edit, Delete and View. It covers most of the basic reports for which you do not need any reporting component like Crystal Report, Report Viewer etc.NET page that will handle different Grid View events to provide complete editing functionality.