Data Format String Causes Other Columns to Update As Well

3 posts, 0 answers
  1. Jessie
    Jessie avatar
    3 posts
    Member since:
    Jun 2018

    Posted 04 Jun 2018 Link to this post

    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. Jessie
    Jessie avatar
    3 posts
    Member since:
    Jun 2018

    Posted 05 Jun 2018 Link to this post

    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

     

     

     

     

  3. Jessie
    Jessie avatar
    3 posts
    Member since:
    Jun 2018

    Posted 05 Jun 2018 Link to this post

    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%.

     

     

Back to Top