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

[Solved] GridClientSelectColumn bug

6 Answers 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 16 Sep 2008, 06:10 PM
when you choose the

AllowMultiRowSelection="true"

setting along with a GridClientSelectColumn, the header text disappears. Also, it appears to be impossible to select a HeaderButtonType or ButtonType for this column, even though these options are presented as available.

Thanks,
-D

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Sep 2008, 06:55 AM
Hi Daniel,

Try the following code snippet to hide the SelectAll checkbox in the header of a client select column and show the header text.

CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridHeaderItem) 
        { 
            GridHeaderItem header = (GridHeaderItem)e.Item; 
            CheckBox chkbx = (CheckBox)header["columnUniqueName"].Controls[0]; 
            header["SelectCol"].Text = "Custom Header"
            chkbx.Visible = false
        }  
    } 


Thanks
Shinu.
0
Daniel
Telerik team
answered on 17 Sep 2008, 03:56 PM
Hello Daniel,

Could you please try to reproduce the mentioned issue using our online demos? Please let us know if you experience the same behavior.
Client-side row selection

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Daniel
Top achievements
Rank 1
answered on 17 Sep 2008, 04:55 PM

Actually I solved my issue by wrapping the grid in some other controls and giving it custom headers that way, which was still able to be done declaratively at design time rather than putting code into the ItemDataBound event to do it at runtime. (it is the Grid_Client_SelectColumn after all! ;)  )

As for reproducing the behavior on the demo site, not sure what is meant by that request, as I don't have access to change the .aspx page to actually demonstrate the issue, but it isn't hard to do.. All you have to do is try to set any other property of the GridClientSelectColumn header when the "AllowMultiRowSelection" is set to true.. you can't set any header text, button, etc. all you get is the checkbox.

Thanks,
-D

0
Daniel
Telerik team
answered on 22 Sep 2008, 12:10 PM
Hello Daniel,

This is known and expected behavior when using AllowMultiRowSelection. You can add header text (or another functionality) as already suggested by Shinu.

Regarding the demos: you can find all demos under your telerik folder in Program files as shown below:
example: C:\Program Files\telerik\RadControls for ASPNET AJAX Q2 2008\Live Demos

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Gaurav
Top achievements
Rank 1
answered on 07 Feb 2013, 05:27 PM
Hi Daniel,

Please do help me out I am facing a similar problem. Just to mention I am using telerik v2.0 Telerik.web.UI.dll 
The problem is that I am using a radgrid and within that I have a GridClientSelectColumn as below:

<Telerik:RadGrid ID="rgdPagePromotion" runat="server" AutoGenerateColumns="false" AllowAutomaticInserts="false" AllowMultiRowSelection="true">
.....
<Telerik:GridClientSelectColumn HeaderText="Promote" DataTextField="Promote" UniqueName="Promote">
</Telerik:GridClientSelectColumn>
.......
 </Telerik:RadGrid>

Now the problem that I am facing is that in the header of the RadGrid I do get a checkbox for toggling all the checkboxes in the GridClientSelectColumn but the header text "promote" does not appear alongside it. If I remove the 
AllowMultiRowSelection="true" from above then the header test "Promote" appears but the checkbox disappears. what I want is the header text to appear alongside (on right side of) the checkbox. 

Could you please look into it and reply me asap please.

Thanks and Regards,

Gaurav Agrawal

Analyst Programmer - Next eCommerce

0
Shinu
Top achievements
Rank 2
answered on 08 Feb 2013, 05:00 AM
Hi,

Try the following code snippet to give HeaderText for the ClientSelectColumn.

ASPX:
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"></telerik:GridClientSelectColumn>

C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridHeaderItem)
    {
        GridHeaderItem item = (GridHeaderItem)e.Item;
        Label lbl = new Label();
        lbl.ID = "Label1";
        lbl.Text = "Promote";
        item["ClientSelectColumn"].Controls.Add(lbl);
    }
}

Thanks,
Shinu.

Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Daniel
Telerik team
Daniel
Top achievements
Rank 1
Gaurav
Top achievements
Rank 1
Share this question
or