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

How to change an editItem from a textbox into radiobutton in autogeneratedcolumn Radgrid?

1 Answer 58 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
shemein asked on 08 Sep 2014, 01:08 PM
I have an autogeneratedcolumn Radgrid that needs to make one of those column  as a radiobuttonlist(Yes No radiobautons). I don't know how I have to do it? Right now in edit mode everything is a textbox. How can I change the textbox of that special column into radiobutonlist? Would you please help me?

‚Äč<telerik:RadGrid ID="QuestionFoundationRadGrid" runat="server" OnNeedDataSource="QuestionFoundationRadGrid_NeedDataSource" OnPreRender="QuestionFoundationRadGrid_PreRender" OnItemCreated="QuestionFoundationRadGrid_ItemCreated" OnUpdateCommand="QuestionFoundationRadGrid_UpdateCommand" OnInsertCommand="QuestionFoundationRadGrid_InsertCommand" OnItemCommand="QuestionFoundationRadGrid_ItemCommand">
<MasterTableView EditMode="PopUp" CommandItemDisplay="Top">
<CommandItemSettings ShowRefreshButton="False" AddNewRecordText="Add New Answer" />
<div style="padding: 5px 5px;">
<table style="width: 100%">

<td style="text-align: right">
<asp:LinkButton ID="AddAnswer" runat="server" CommandName="InitInsert"><img style="border:0px;vertical-align:middle;" alt="" runat="server" src="~\Images\AddRecord.png"/>&nbsp;&nbsp;Add New Answer</asp:LinkButton>&nbsp;&nbsp;
<RowIndicatorColumn Visible="False">
<ExpandCollapseColumn Created="True">

<telerik:GridEditCommandColumn ButtonType="ImageButton" ColumnGroupName="Actions" HeaderStyle-CssClass="header" UniqueName="EditCommandColumn" >
<HeaderStyle CssClass="header" />
<ItemStyle HorizontalAlign="Center" Width="15" CssClass="MergedBorder"/>


<telerik:GridTemplateColumn UniqueName="DeleteColumn" ColumnGroupName="Actions" AllowFiltering="False" >
<asp:ImageButton ID="DeleteImageButton" runat="server" AlternateText="Delete Toolkit" CommandName="Delete"
OnClientClick="javascript:if(!confirm('This action will delete the selected Answer. Are you sure?')){return false;}"
ImageUrl="~\Images\delete-icon.png" />
<HeaderStyle CssClass="header" />
<ItemStyle HorizontalAlign="Center" Width="5"/>

<telerik:GridColumnGroup HeaderStyle-HorizontalAlign="Center" HeaderText="Actions" Name="Actions" >
<HeaderStyle HorizontalAlign="Center"/>



1 Answer, 1 is accepted

Sort by
Konstantin Dikov
Telerik team
answered on 11 Sep 2014, 06:37 AM
Hello Shemein,

For setting custom column editors to auto-generated column you can handle the server-side OnCreateColumnEditor event and replace the column editor with your custom one.

Detailed information and an example are available in the following help article:
Hope this helps.

Konstantin Dikov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question