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

[Solved] Server side select with check box

4 Answers 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AdamL
Top achievements
Rank 1
AdamL asked on 14 May 2008, 06:33 PM
I imagine that I will either have to post my entie code or open an incident for this but I will try this first.  I have a grid that mimics the server-side select example found here:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/SelectRowWithCheckBox/DefaultCS.aspx

However, I have some slight difference: 

1.  I have a needdatasource event to populate the grid from Oracle
2.  I have an ItemDataBound event to change the background color of certain cells.
3.  I have a DetailTable for a grid within the grid heirarchy. (the detailtable does not allow selection)

I am encountering an issue where the selection is hit-or-miss. Most of the time, I can select two items but, upon selecting the third, the first two become unselected.  Also,  If I select a row then expand it, the selection is removed.

Does this sound like I am missing something obvious?  I am putting together a sample project just in case.

Thanks in advance.

- Adam

4 Answers, 1 is accepted

Sort by
0
AdamL
Top achievements
Rank 1
answered on 14 May 2008, 08:03 PM
I was able to duplicate this in a test project.  I have created and submitted a ticket for this.  I have noticed that the selection issues are directly related to the height of the grid and enabling scrolling.  If all grid items display in the grid without scrollbars, the selection works fine but, when scrollbars are displayed, the selection becomes an issue.

- Adam
0
Yavor
Telerik team
answered on 15 May 2008, 07:43 AM
Hello Adam,

We will review the support ticket that you have opened on the matter, and address the question. To avoid duplicate posts, I will close this thread.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael
Top achievements
Rank 1
answered on 23 Jun 2008, 04:14 PM
I came across this same issue with me hiding a portion of the grid to use scrolling. 

<ClientSettings> 
 <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="88px" /> 
</ClientSettings> 

I used the GridTemplateColumn to do the serveer side selecting like in your online demo example.

When scrolling down and selecting more items the above rows are deselected, but the checkbox's are still checked atleast.

I did the following in the example to reselect the rows that were not visible from the scroll.

    protected void ToggleRowSelection(object sender, EventArgs e) 
    { 
        ((sender as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked; 
 
        //ReSelect rows that are checked. 
        foreach (Telerik.Web.UI.GridDataItem dataItem in RadGrid1.MasterTableView.Items) 
        { 
            if ((dataItem.FindControl("CheckBox1"as CheckBox).Checked) 
                dataItem.Selected = true
        } 
    } 

0
Yavor
Telerik team
answered on 26 Jun 2008, 07:52 AM
Hi Michael,

I have to confirm that this is a bug in the present version of the control.
It only occurs when you have set the ScrollHeight property.
I have alerted our developers, for this issue, and they will soon address it.
You can remove the scrollheight property in the meantime, as a temporary work-around.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
AdamL
Top achievements
Rank 1
Answers by
AdamL
Top achievements
Rank 1
Yavor
Telerik team
Michael
Top achievements
Rank 1
Share this question
or