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

[Solved] Find Selected Checkbox in grid

2 Answers 115 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.
wdudek
Top achievements
Rank 1
wdudek asked on 18 Oct 2010, 07:49 PM


Below is some partial code that defines a couple of columns and a checkbox in the grid, how can I loop through the grid and find what rows have checkboxes that are checked? I tried using the Items collection and IndexOf(object) which gave m the row but now I can't figure out what to do with that? Basically the user can look at orders, select 1 or more and then click submit to send them on their way, or at least that is the idea if I could tell which ones were submitted.

Thanks
Bill

<my:RadGridView.Columns>
                 <my:GridViewColumn Header="Mark to submit">
                     <my:GridViewColumn.CellTemplate>
                         <DataTemplate>
                             <CheckBox x:Name="MarkToSubmit"></CheckBox>
                         </DataTemplate>
                     </my:GridViewColumn.CellTemplate>
                 </my:GridViewColumn>
                 <my:GridViewDataColumn DataMemberBinding="{Binding TradingPartnerID}" Header="Trading Partner" UniqueName="TradingPartnerID" ></my:GridViewDataColumn>
                 <my:GridViewDataColumn DataMemberBinding="{Binding AccountNumber}" Header="Account #" UniqueName="AccountNumber" ></my:GridViewDataColumn>

2 Answers, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 21 Oct 2010, 01:28 PM
Hi William,

 I'm afraid that you won't be able to iterate over all your Checkboxes in the RadGridView, because of UI Virtualization. Could you please try to bind the Checkbox in the cell to a property of your data object instead? 

Kind regards,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
wdudek
Top achievements
Rank 1
answered on 21 Oct 2010, 02:57 PM
ok thanks, that is what I ended up doing and it is working.
Tags
GridView
Asked by
wdudek
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
wdudek
Top achievements
Rank 1
Share this question
or