Adding DataMemberBinding for sorting is messing up Editing Template

4 posts, 0 answers
  1. James
    James avatar
    5 posts
    Member since:
    Jan 2013

    Posted 14 Jan 2015 Link to this post

    GridView V2014.1.0428.45

    So I have the following GridViewDataColumn.  Everything was working fine with the editing binding until I added the DataMemberBinding to the GridViewDataColumn header to facilitate sorting.

    <telerikGrid:GridViewDataColumn IsReadOnly="{Binding Data.IsReadOnly, Source={StaticResource bindingProxy}}"
                                                                Header="Public Domain" HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}" Width="100"
                                                                DataMemberBinding="{Binding PublicDomain}">
                                    <telerikGrid:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding PublicDomain}" />
                                        </DataTemplate>
                                    </telerikGrid:GridViewDataColumn.CellTemplate>
                                    <telerikGrid:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <TextBox Text="{Binding PublicDomain, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                     PreviewTextInput="PublicDomainTextBox_PreviewTextInput" />
                                        </DataTemplate>
                                    </telerikGrid:GridViewDataColumn.CellEditTemplate>
                                </telerikGrid:GridViewDataColumn>

    Once I added the DataMemberBinding to the ColumnHeader, now when I navigate out of this cell on the Grid, I get an additional set to PublicDomain that sets it back to null, no matter what the user has typed into the TextBox.  I've verified that taking out the DataMemberBinding returns things to working.

    My understanding was that adding that DataMemberBinding shouldn't change the behavior of the CellEditTemplate.  Is there something else that's been done wrong here that could be causing the binding to not work properly once DataMemberBinding is set?

    Thanks.

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 15 Jan 2015 Link to this post

    Hi,

    You can specify SortMemberPath to configure the sorting to be done based on a property directly. You can also use GridViewColumn in that case.

    How does this work for you?

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. James
    James avatar
    5 posts
    Member since:
    Jan 2013

    Posted 15 Jan 2015 in reply to Dimitrina Link to this post

    Well, that doesn't work for us, but I honestly can't figure out what is wrong.  I've downloaded the test app that you sent us in a previous problem in December and can't reproduce the problems we are having.  I don't know why the GridView works differently in our app than it does in your test applications but it is unbelievably frustrating and a massive time sink.   I don't know what exactly we are doing, but something we are doing is breaking the grid and causing it to send out odd results in binding (especially with Nullable DateTimes) and causing all kinds of bizarre problems for us. 

    I spent about 8 hours hacking around the problems yesterday and got the grid into a workable state, but the stuff I did to make it work is just off the wall..  At this point I honestly have no idea how to get the grid working properly in our app.  I'm sure it's something odd that we have done, but I don't have a good idea of how to diagnose what or fix it. 
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 17 Jan 2015 Link to this post

    Hi,

    In your previous reply you said it is working fine if no DataMemberBinding is specified. Have you deleted it and tried just using SortMemberPath instead?

    If so, and you still experience the problem, may I ask you to try isolating the issue in a demo project illustrating your exact setup and send it to us in a support ticket? You can also take a look at this blog post for a reference on how to isolate an issue. 

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top