Home Forums WinForms controls Xceed Grid for WinForms Cell Conten is "Null"

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17250 |

    Hello

     i´ve a problem to edit data , when i use the  “EditEnd” Event , the event launches when i am finished with my input in the current row , now i can  use

    string

    s2 = dataR.Cells[2].FieldName.ToString();

    this is no problem and works

    dataR.Cells[2].Content =

    “test”;

    this works also.

    But if i want to get the value of the current datarow cell[2] there is an error

    string s1 = dataR.Cells[2].Content.ToString();

     

    My XAML is

    <

    xcdg:DataGridControl Margin=”0,0,-2,0″ Name=”dataGridControl1″ >

    <xcdg:DataGridControl.Resources>

    <Style TargetType=”{x:Type xcdg:DataRow}”>

     

    <EventSetter Event=”xcdg:Row.EditEnded” Handler=”OnDataRowEditEnd”/>

    </Style>

    </xcdg:DataGridControl.Resources>

    </xcdg:DataGridControl>

     

    my C# Code is :

    private void OnDataRowEditEnd(object sender, RoutedEventArgs e)

    {

    Xceed.Wpf.DataGrid.DataRow dataR = (Xceed.Wpf.DataGrid.DataRow)sender;

    dataR.Cells[1].Content = “test”;

    string s2 = dataR.Cells[2].FieldName.ToString();

     

    string s1 = dataR.Cells[2].Content.ToString();

    }

     

    Has anybdy an idea whats wrong ?

    I used the mouse double click event and there it works .

     

    Imported from legacy forums. Posted by Victor (had 615 views)

    User (Old forums)
    Member
    Post count: 23064

    I found the problem .

    <EventSetter Event=”xcdg:Row.EditEnded” Handler=”OnDataRowEditEnd”/> is wrong it must be

    <

    EventSetter Event=”xcdg:Cell.EditEnded” Handler=”OnDataRowEditEnd”/>

     

    Now it works

    Imported from legacy forums. Posted by Victor (had 750 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.