This is a migrated thread and some comments may be shown as answers.

Data Format String Causes Other Columns to Update As Well

2 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jessie
Top achievements
Rank 1
Jessie asked on 04 Jun 2018, 08:18 PM

Hello Everyone,

Really weird situation I'm experiencing right now. I've got a Radgrid with batch edit enabled. Updating data works fine, until I apply DataFormatString="{0:P2}" on certain columns. When that is applied, all columns with that same format get updated as well by a multiple of 100 if they have a non 0 value to start. 

Attached are screenshots of what is happening. In screenshot 1,I changed a column on the first row from having a value of 16.7% to 5%. In screenshot 2 you can see a value in another column on the same row, one that I did not update, multiply itself by 100. Again, without the data format string, the updating works as expected (only what I update physically gets updated).

I am using Sqldatasource to query for and update this data.

Anyone else have an explanation as to why this is happening?

 

Thanks

 

2 Answers, 1 is accepted

Sort by
0
Jessie
Top achievements
Rank 1
answered on 05 Jun 2018, 05:21 PM

Figured it out, answer was staring at me right in the face.

Just because I wasn't physically editing another column on the same row, it didn't mean a column was actually being updated.

For example, 

display values:

Col 1       Col 2
5%             6%

during edit values:

Col 1         Col 2

.05            6%            <-------------col 2untouched

after edit:

Col 1         Col 2

5%             600%

Value of 6 and not .06 is being used in the update

 

 

 

 

0
Jessie
Top achievements
Rank 1
answered on 05 Jun 2018, 07:37 PM

Oh yeah, forgot to mention. I was using Data Format String {0:P2} to display values as a percentage, but  I should have been using {0:N0}%. Using that you can type in, let's say, 2 and the value will be saved as 2% instead of 200%.

 

 

Tags
Grid
Asked by
Jessie
Top achievements
Rank 1
Answers by
Jessie
Top achievements
Rank 1
Share this question
or