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

Rad button Toggle in RadGrid not working

1 Answer 146 Views
Button
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 02 Apr 2012, 08:29 PM
Hello,

I have a radgrid where I need an old fashioned radio button in a column to allow the user to select the item on that row. I already have a column of checkboxes to allow user to select multiple rows for another purpose, so I suspect I cannot use "row select" properties of the grid. The checkboxes determine which items are used in a report, while the radio button's purpose is to select a single item  that is displayed in the report header.

I added a radbutton (Code below) to the grid, but when it runs, it allows me to check more than one radio button. How do I make it select only one?

Thanks!

 

 

<telerik:GridTemplateColumn UniqueName="DisplayInvoice" HeaderText="Select Display Invoice #"  

 

    HeaderStyle-Width="20%" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"

     ItemStyle-Width="20%" >

    <ItemTemplate>

        <telerik:RadButton ID="rbInvoiceDisplay" GroupName="grpInvoiceDisplay" AutoPostBack="false"

            ButtonType="ToggleButton" ToggleType="Radio" runat="server">

            <ToggleStates>

                <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleRadioChecked" />

                <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleRadio" />

            </ToggleStates>

        </telerik:RadButton>

    </ItemTemplate>

 /telerik:GridTemplateColumn>

 

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 05 Apr 2012, 01:22 PM
Hi Bruce,

Please check the implementation in the code library article RadioButton column in RadGrid. The requested functionality is achieved via a customized radio button control that inherits the RadioButton class.

I hope this solution will meet your requirements. Feel free to contact us again if you run into more difficulties.

Greetings,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Button
Asked by
Bruce
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or