Avatar of thorv71
thorv71Flag for Norway

asked on 

Keep changed value in cell when sorting and before saving in DataGridView

I have a datagridview With bindingsource where I list many Products, and in the first cell the user can enter how many items they want of each Product in the quantity cell, and then they click the "Order" button.

The problem is when the user has set how many Items they want and then want to sort by name, the values in the quantity cell is gone.

How is the most easy way to keep the entered quantity values when they sort the Grid ?
Visual Basic.NETProgramming Languages-Other.NET Programming

Avatar of undefined
Last Comment
it_saige
Avatar of it_saige
it_saige
Flag of United States of America image

Sounds like you are not storing the value entered by the user back to the datasource.  What is the code you are using to trigger the editing of the cell and saving the value entered.

-saige-
Avatar of thorv71
thorv71
Flag of Norway image

ASKER

No code at that point, the Cell is just open for editing.

The saving happens when you hit the button "Send order". Then I loop all the rows and check if the row has got a Quantity, if it has, I save the Quantity and the productID of the row.
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo