Hello
i wanna make aList of ID from click on gridview devexpress row or cell
when i click save button
it's make forEach on This List and give me Alist Of item
for Example =>..
i want to click on this X button get me id of this row from dataBase and add it to Alist of IDS
how i can make it please ?!

Prasad RaveendranPosted Jul 4, 2024, 11:16 PM
To achieve the desired functionality using DevExpress GridView, you can follow these steps:
Handle the Row/Cell Click Event to Capture the ID:
Handle the Save Button Click Event:
Here’s an example of how you can implement this in a Windows Forms application:
Step 1: Initialize the ListCreate a list to store the IDs globally within your form.
Step 2: Handle the Row/Cell Click EventAttach an event handler to the GridView’s click event to capture the ID and add it to the list.
Step 3: Handle the Save Button Click EventWhen the save button is clicked, iterate through the list of IDs and retrieve the items from the database.
Replace
YourItemTypeand theGetItemFromDatabasemethod with your actual data model and data retrieval logic. This example assumes that your data model has an ID column and that you have a method to retrieve items from the database by their ID.