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

Edit value that is passed on from CellEditEnded if data passed in is empty

1 Answer 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marcus
Top achievements
Rank 1
Marcus asked on 10 Aug 2012, 07:18 AM
Hey there!

Im trying to change the value of a  field if the content of it is null/white spaces. Im using the CellEditEnded event.

I've tried with my gridview's name.CurrentCell.Value="#" also tried with e.Cell.Value="#"

With no luck. Any idea? Should be fairly simple, but I can't figure it out.

Here's my code.
private void EditingRowsGrid_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
      {
 
          if (string.IsNullOrWhiteSpace(e.NewData.ToString()))
          {
              // Insert content here to set the value to "#"
          }
         ;
      }

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 Aug 2012, 11:55 AM
Hi,

 Why not handle this directly in the data item property setter? 

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Marcus
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or