У нас вы можете посмотреть бесплатно ASP.NET GridView Search with DataKeyNames или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Visit my forum: http://www.programmermind.com Learn how to use the GridView Datakeys to search through columns. The captured data can then be output to textboxes or labels. This example uses a textbox as a search query and then outputs data from a Microsoft Access database to the screen. It also demonstrates how to use checkboxes to change data output to a Gridview. So clicking on multiple checkboxes will alter the data each time to the GridView. Datakeys are bound within a GridView and used to save the value within a particular field. You can also scan the rows too as well. Here is an example of Datakeys stored in a Gridview loop. foreach (GridViewRow gvr in GridView1.Rows) { DKStaffNumber = GridView1.DataKeys[gvr.RowIndex].Values[0].ToString(); DKName = GridView1.DataKeys[gvr.RowIndex].Values[1].ToString(); DKEducation = GridView1.DataKeys[gvr.RowIndex].Values[2].ToString(); DKExperience = GridView1.DataKeys[gvr.RowIndex].Values[3].ToString(); DKHourlyRate = GridView1.DataKeys[gvr.RowIndex].Values[4].ToString(); DKLocation = GridView1.DataKeys[gvr.RowIndex].Values[5].ToString(); DKAvailability = GridView1.DataKeys[gvr.RowIndex].Values[6].ToString(); findStaffNumber.Add(DKStaffNumber); findName.Add(DKName); findEducation.Add(DKEducation); findExperience.Add(DKExperience); findHourlyRate.Add(DKHourlyRate); findLocation.Add(DKLocation); findAvailability.Add(DKAvailability); } Once you have the Datakeys saved (such as DKName) then you can use an array like findName.Add(DKName) to be used later in the application. Hopefully this video will encourage and get you started on using Datakeys. Now you can also save information into bound textboxes or labels. I don't have any example to show you that now though. Also the Datakeys can be created in the Design section. Just click on the GridView and click on Edit Columns. You can then click on BoundField under Available fields and press the Add button. Once your data is bound you can then rename the field under HeaderText in the Boundfield properties. The DataField area is used to point to the column in your SQL statement. You can also turn them off by setting Visible to False. There are many other preferences so have a look at them there. Happy coding!