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 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shemein
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" />
<CommandItemTemplate>
<div style="padding: 5px 5px;">
<table style="width: 100%">
<tr>

<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;
</td>
</tr>
</table>
</div>
</CommandItemTemplate>
<RowIndicatorColumn Visible="False">
</RowIndicatorColumn>
<ExpandCollapseColumn Created="True">
</ExpandCollapseColumn>
<Columns>

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

</telerik:GridEditCommandColumn>

<telerik:GridTemplateColumn UniqueName="DeleteColumn" ColumnGroupName="Actions" AllowFiltering="False" >
<ItemTemplate>
<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" />
</ItemTemplate>
<HeaderStyle CssClass="header" />
<ItemStyle HorizontalAlign="Center" Width="5"/>
</telerik:GridTemplateColumn>

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

</telerik:GridColumnGroup>
</ColumnGroups>
<EditFormSettings>
                               
                            </EditFormSettings>

</MasterTableView>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
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.


Regards,
Konstantin Dikov
Telerik
 

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.

 
Tags
Grid
Asked by
shemein
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or