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
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.
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.
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
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.
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
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.