Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
985
How do I update values in another row column using data binding
posted

I am using DataGrid (bind to the obeservable collection), one of the column in the datagrid is checkbox, User Requirement is, when user checks checkbox in any row, other row's checkbox should reset to unchecked. means  only one checkbox checked at a time.

I tried using INotifyPropertyChanged but no luck, please suggest. Thanks

                    <igGrid:XamWebGrid x:Name="_dgAppInfo" AutoGenerateColumns="False" ColumnWidth="*" ItemsSource="{Binding AppList}">
                        <igGrid:XamWebGrid.EditingSettings>
                            <igGrid:EditingSettings AllowEditing="Row" IsEnterKeyEditingEnabled="True" IsF2EditingEnabled="True" IsMouseActionEditingEnabled="SingleClick" IsOnCellActiveEditingEnabled="True" />
                        </igGrid:XamWebGrid.EditingSettings>
                        <igGrid:XamWebGrid.SelectionSettings>
                            <igGrid:SelectionSettings CellClickAction="SelectRow" RowSelection="Single"></igGrid:SelectionSettings>
                        </igGrid:XamWebGrid.SelectionSettings>
                        <igGrid:XamWebGrid.Columns>
                            <igGrid:TextColumn Key="AppID"  HeaderText="ID"/>
                            <igGrid:TextColumn Key="AppName" Width="*" HeaderText="Name"/>
                            <igGrid:CheckBoxColumn Key="AppActive" Width="*" HeaderText="Active"/>
                        </igGrid:XamWebGrid.Columns>
                    </igGrid:XamWebGrid>

Parents
  • 40030
    Offline posted

    Hi, 

    You'd have to write some custom logic, outside the grid.  Specifically, you're going to need to hook up the INotifyPropertyChanged event to every item in your collection. Then keep track of the item that is currently checked.  When the NotifyPropertyChanges for that property, you'd change the item that was checked to false. 

    Hope this helps get you started. 

    -SteveZ

Reply Children