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

[Solved] Get Non Selected Rows

3 Answers 122 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.
Yogesh
Top achievements
Rank 1
Yogesh asked on 21 Dec 2010, 11:26 AM
Hi,

I am using Rad Gridview in my silverlight project. In that I have a checkbox column in every row. Now I want only those rows which are not selected or checked in checkbox ( Means.. rows which are not selected ).

I have added GridviewSelectionColumn for selecting rows.


Please help me with this ASAP. If possible please give me an example.


Thanks,
Yogesh

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 21 Dec 2010, 12:16 PM
Hi Yogesh,

If you want to gather all rows that are not selected, you may just verify if their IsSelected property is true or false. On the other hand, if you use a CheckBox column whose IsChecked property is bound to a property in your Business object, you may run through the Items collection of the grid and get those items, whose property is True/ False.
 

Best wishes,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Yogesh
Top achievements
Rank 1
answered on 21 Dec 2010, 01:12 PM
Hi Maya,

Thanks for the reply.

But I am currently stucked with the same problem, because in RadGridView i have not found any property like "isSelected".

Please reply with some code if possible.!


Thanks.
Yogesh
0
Accepted
Maya
Telerik team
answered on 21 Dec 2010, 01:26 PM
Hi Yogesh,

The IsSelected is a property of the GridViewRow. So, for example you may implement your logic like:

private void Button1_Click(object sender, RoutedEventArgs e)
        {
            foreach(Player player in this.playersGrid.Items)
            {
                var row = this.playersGrid.ItemContainerGenerator.ContainerFromItem(player) as GridViewRow;
                if(row.IsSelected)
                {
                    //you may implement your custom logic here.
                }
            }
        }
 

Greetings,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Yogesh
Top achievements
Rank 1
Answers by
Maya
Telerik team
Yogesh
Top achievements
Rank 1
Share this question
or