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

Select column in radgridview

6 Answers 524 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin Tran
Top achievements
Rank 1
Kevin Tran asked on 11 Jun 2010, 05:53 AM
Hi support,
I have a requirement in which i have to display a check box in grid , which is multi selectable , There is a button outside grid, In that button click i have to get all the checked columns id, and have to send these ids to another .aspx page as querystring.

For this i have taken a select column , as there is no data binding property for select column, i am unable to bind any id for that.

Can i access invisible column in radgridview. How can i pass parameters to the javascript function from code behind to .aspx javascript function.

   <telerikGridView:GridViewSelectColumn  Header="ATU Name" FooterTextAlignment="Left" IsReorderable="False" IsFilterable="False"  > 
 
                        </telerikGridView:GridViewSelectColumn> 
                        <telerikGridView:GridViewDataColumn  UniqueName="id" FooterTextAlignment="Left" IsReorderable="False" IsVisible="False" IsFilterable="False"  DataMemberBinding="{Binding id}"
 
                        </telerikGridView:GridViewDataColumn> 

  private void btnMulticheck_Click(object sender, RoutedEventArgs e) 
        { 
            List<int> checkedRows = new List<int>(); 
 
            
            var rows = this.gvData.ChildrenOfType<GridViewRow>(); 
 
            foreach (var row in rows) 
            { 
                if (row is GridViewNewRow) 
                    continue
 
                var checkbox = row.Cells[0]; 
                var id = row.Cells[1]; 
 
 
                CheckBox cb = (CheckBox)((System.Windows.Controls.ContentControl)(checkbox)).Content; 
 
                if (cb.IsChecked == true)  
                { 
                    checkedRows.Add((int)((Telerik.Windows.Controls.GridView.GridViewCell)(id)).Value); 
                } 
 
                HtmlPage.Window.Invoke("SayHello"); 
               
            } 
 
         
        } 

Can you suggest me some alternative as i cant show id column to user, And what happens if user scrolls after selecting? Can i access those selected check boxes?
I am using silverlight Q1 2010 10.1.3.9 version,Is it fully tested version,? Why so many events are not accessible in this version.
Is there any documentation available for this version

Thanks

6 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 11 Jun 2010, 12:32 PM
Hi Kevin Tran,

 Do you mean that you wish to get the rows in which the CheckBox in the Select column is checked?

Best wishes,
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
Rakesh
Top achievements
Rank 1
answered on 20 Dec 2010, 06:26 AM
Hello,

I need the same thing, I want to bind the GridViewSelectColumn to a database datatable so that the rows are according to the value of the datatable.
Please provide some code for it.

Thanks.
0
Vlad
Telerik team
answered on 20 Dec 2010, 09:01 AM
Hi,

 GridViewSelectColumn is already bound to the row IsSelected property in order to select rows. 

Kind regards,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Rakesh
Top achievements
Rank 1
answered on 20 Dec 2010, 10:24 AM
Sorry I could not explain you the thing properly, Let me try It again....In my radgrid the their are two colums which are binded to a database table one column have checkbox status and other column contain some data. I want that when user selects a row by checking checkbox the status of the database table for that row('Checked') changes. 
After Selecting the row, when I check the table.GetChages() for the table which is binded to the radgrid shows null;
that is when I select a row the, binded table is not updating it's status. For other columns I can use DataMemberBinding property but what to use for GridViewSelectionColumn, I also tried using Selector.IsSelected to bind the corresponding column of database table, but it is not working. Please provide me some code for that.

thanks.
0
Vlad
Telerik team
answered on 20 Dec 2010, 10:44 AM
Hi,

 You should use GridViewCheckBoxColumn for editing purposes. GridViewSelectionColumn is for selection not for editing and it is tightly coupled with RadGridView.  

All the best,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Makarand
Top achievements
Rank 1
answered on 11 Nov 2011, 11:00 AM
can u give us an example for GridViewCheckBoxColumn..
how to i get multiple checkbox selection in radgridview.
Tags
GridView
Asked by
Kevin Tran
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Rakesh
Top achievements
Rank 1
Vlad
Telerik team
Makarand
Top achievements
Rank 1
Share this question
or