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

Databound Combobox inside RadGrid

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SilverFish
Top achievements
Rank 1
SilverFish asked on 20 Feb 2017, 07:53 PM

Requirements

Telerik Product and Version

2017.1.118.40 Telerik.Web.UI

Supported Browsers and Platforms

Internet Explorer 11

Components/Widgets used (JS frameworks, etc.)



PROJECT DESCRIPTION 
I am new to Telerik. I have to create a RadGrid with Insert/Update/Delete functionality using onneeddatasource. the code is working to some extent, but I need that when Edit template is opened, there should be databound dropdowns rather than textboxes. Similarly functionality for insert.

<%@ PageLanguage="C#"AutoEventWireup="true"CodeBehind="ReviewerMaintenance.aspx.cs"
    Inherits="textXslt.ReviewerMaintenance"%>

<%@ RegisterAssembly="Telerik.Web.UI"Namespace="Telerik.Web.UI"TagPrefix="telerik"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Reviewer Maintenance</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1"runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadScriptManager ID="RadScriptManager1"runat="server">
    </telerik:RadScriptManager>
    <div>
        <div>
            <telerik:RadGrid ID="RadGrid1"runat="server"AllowFilteringByColumn="True"AllowPaging="True"
                AllowSorting="True"AutoGenerateColumns="False"OnNeedDataSource="radGrid_NeedDataSource"
                Width="97%"OnDeleteCommand="RadGrid1_DeleteCommand"OnInsertCommand="RadGrid1_InsertCommand"
                OnUpdateCommand="RadGrid1_UpdateCommand"EnableAJAX="True"ShowGroupPanel="True"
                Skin="Bootstrap">
                <PagerStyleMode="NextPrevAndNumeric"></PagerStyle>
                <GroupingSettingsCollapseAllTooltip="Collapse all groups"></GroupingSettings>
                <ClientSettingsAllowDragToGroup="True">
                    <ScrollingAllowScroll="True"UseStaticHeaders="True"/>
                </ClientSettings>
                <MasterTableViewAutoGenerateColumns="False"DataKeyNames="AccessID"Width="100%"
                    CommandItemDisplay="Top">
                    <Columns>
                        <telerik:GridButtonColumn CommandName="Delete"Text="Delete"UniqueName="Delete">
                        </telerik:GridButtonColumn>
           <telerik:GridBoundColumn DataField="AccessID" DataType="System.Int32" FilterControlAltText="Filter AccessID column"
                            HeaderText="Access ID" ReadOnly="True"SortExpression="AccessID"UniqueName="AccessID">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FirstName"FilterControlAltText="Filter FirstName column"
                            HeaderText="First Name" ReadOnly="True" SortExpression="FirstName" UniqueName="FirstName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastName"FilterControlAltText="Filter LastName column"
                            HeaderText="Last Name" ReadOnly="True" SortExpression="LastName" UniqueName="LastName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FormName"FilterControlAltText="Filter FormName column"
                            HeaderText="Form Name" SortExpression="FormName" UniqueName="FormName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ContactType"FilterControlAltText="Filter ContactType column"
                            HeaderText="Contact Type" SortExpression="ContactType" UniqueName="ContactType">
                        </telerik:GridBoundColumn>
                        <telerik:GridEditCommandColumn>
                        </telerik:GridEditCommandColumn>
                    </Columns>
                    <EditFormSettingsColumnNumber="2"CaptionFormatString="Edit details for Access ID {0}"
                        CaptionDataField="AccessID">
                        <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                        <FormMainTableStyle CellSpacing="0"CellPadding="3"Width="100%"/>
                        <FormTableStyle GridLines="Horizontal"CellSpacing="0"CellPadding="2"CssClass="module"
                            Height="110px"Width="50%"/>
                        <FormTableAlternatingItemStyleWrap="False"></FormTableAlternatingItemStyle>
                        <FormStyle Width="50%" BackColor="#EEF2EA"></FormStyle>
                        <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                        </EditColumn>
                        <FormTableButtonRowStyle HorizontalAlign="Right"CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                    </EditFormSettings>
                    <ExpandCollapseColumnVisible="False">
                        <HeaderStyle Width="19px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <RowIndicatorColumnVisible="False">
                        <HeaderStyle Width="20px"/>
                    </RowIndicatorColumn>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </div>
    </form>
</body>
</html>

 


1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 23 Feb 2017, 08:26 AM

Hello,

Could you take a look in my answer in your other thread: http://www.telerik.com/forums/sample-project-for-radgrid-using-dropdown-for-edit-insert? I hope it covers your questions. As a general rule of thumb, opening several threads with the same question does not result in faster answers or greater popularity, it usually dilutes the thread and scatters information, making it harder to get help.



Regards,


Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
SilverFish
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or