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

unfinished combobox in Radgrid :(

3 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adem
Top achievements
Rank 1
Adem asked on 14 Nov 2012, 02:37 PM
Hi..

i am really struggling to learn about telerik tools and i really want to use the radgrid with its all features. But i was stucked with "putting a combobox in grid" :((

i have found many codes from telerik's site but i could not assign it to my own project :( i did all i could do but there was always errors.. :((

could you please help me and rescue me from this situation please.. 

here is my code of Radgrid.. i am new in telerik. 

and could you please give me some simple examples, tutorials etc. to make me get rid of this stressful situation please..

thanks to you..



here is my code :


<telerik:RadGrid ID="OdemeEkleDuzenle" runat="server" DataSourceID="AdemButce" AllowFilteringByColumn="True"
                    AllowPaging="True" AllowSorting="True" CellSpacing="0" Culture="tr-TR" GridLines="None"
                    Height="100%" PageSize="18" ShowGroupPanel="True" AutoGenerateColumns="False"
                    AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AllowAutomaticDeletes="True"
                    Style="text-align: left" GroupingSettings-GroupContinuesFormatString=" Bir sonraki sayfada da devamı var.."
                    GroupingSettings-GroupContinuedFormatString=".. bir önceki sayfadan devam eden bilgiler.."
                    GroupingSettings-GroupSplitDisplayFormat="Showing {0} of {1} items.">
                    <GroupingSettings GroupContinuedFormatString=" ... Bir önceki sayfadaki gruplamanın devamı. "
                        GroupContinuesFormatString=" Gruplama Bir Sonraki Sayfada da devam ediyor... "
                        GroupSplitDisplayFormat="Toplam {1} kaydın {0} tanesi gösteriliyor.. " UnGroupButtonTooltip="Gruplamayı kaldırmak için burayı tıklayınız.."
                        UnGroupTooltip="Gruplamayı kaldırmak için sütunu buradan dışarı sürükleyin.." />
                    <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" AllowKeyboardNavigation="True"
                        ColumnsReorderMethod="Reorder" EnableRowHoverStyle="True">
                        <DataBinding EnableCaching="True">
                        </DataBinding>
                        <Selecting AllowRowSelect="True" />
                        <ClientMessages DragToGroupOrReorder="Gruplamak veya sıralamak için yukarıdaki gruplama alanına sürükleyip bırakın"
                            DragToResize="Yeniden boyutlandır" DropHereToReorder="Tekrar Sıralamak için buraya sürükleyip bırakın." />
                        <Resizing AllowColumnResize="True" />
                    </ClientSettings>
                    <GroupPanel Text="Gruplamak istediğiniz sütunu buraya sürükleyin..">
                    </GroupPanel>
                    <MasterTableView AutoGenerateColumns="False" DataSourceID="AdemButce" Caption="ÖDEMELERİM"
                        AlternatingItemStyle-VerticalAlign="Middle" GridLines="None" CommandItemDisplay="Top"
                        NoMasterRecordsText="No Categories have been added.">
                        <CommandItemSettings ExportToPdfText="PDF dosyasına aktar" AddNewRecordText="Yeni Kayıt Ekle"
                            RefreshText="Listeyi Yenile" ExportToExcelText="Excel Dosyasına aktar" ExportToCsvText="Csv dosyasına aktar"
                            ExportToWordText="Word dosyasına aktar" />
                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                                EditFormColumnIndex="0" EditText="Düzenle" Groupable="True" HeaderStyle-Width="2%"
                                UpdateText="Güncelle" HeaderText="Dznl">
                                <HeaderStyle Width="2%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="S_nu" DataType="System.Decimal" HeaderText="S_nu"
                                SortExpression="S_nu" UniqueName="S_nu" FilterImageToolTip="Süz" FilterControlAltText="Filtrele"
                                FilterControlWidth="80%">
                                <HeaderStyle Width="2%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ADI" HeaderText="Ödeme Adı" SortExpression="ADI" UniqueName="ADI"
                                FilterImageToolTip="Süz" FilterControlAltText="Filtrele" FilterControlWidth="80%">
                                <HeaderStyle Width="10%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="KIMLIK" HeaderText="Alacaklı Kişi / Firma" SortExpression="KIMLIK"
                                UniqueName="KIMLIK" FilterImageToolTip="Süz" FilterControlAltText="Filtrele"
                                FilterControlWidth="80%">
                                <HeaderStyle Width="10%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="BAS_TAR" DataType="System.DateTime" HeaderText="Başlama Tarihi"
                                SortExpression="BAS_TAR" UniqueName="BAS_TAR" DataFormatString="{0:dd MMMM yyyy}"
                                FilterImageToolTip="Süz" FilterControlAltText="Filtrele" FilterControlWidth="70%">
                                <HeaderStyle Width="8%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="BIT_TAR" DataType="System.DateTime" HeaderText="Bitiş Tarihi"
                                SortExpression="BIT_TAR" UniqueName="BIT_TAR" DataFormatString="{0:dd MMMM yyyy}"
                                FilterImageToolTip="Süz" FilterControlAltText="Filtrele" FilterControlWidth="70%">
                                <HeaderStyle Width="8%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ODENECEK_TUTAR" DataType="System.Decimal" HeaderText="Ödenecek Tutar"
                                SortExpression="ODENECEK_TUTAR" UniqueName="ODENECEK_TUTAR" DataFormatString="{0:###,###.## TL}"
                                FilterImageToolTip="Süz" FilterControlAltText="Filtrele" FilterControlWidth="80%">
                                <HeaderStyle Width="8%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TAKSIT_SAYISI" DataType="System.Decimal" HeaderText="Taksit Sayısı"
                                SortExpression="TAKSIT_SAYISI" UniqueName="TAKSIT_SAYISI" FilterImageToolTip="Süz"
                                FilterControlAltText="Filtrele" FilterControlWidth="70%">
                                <HeaderStyle Width="6%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TAKSIT_TUTAR" DataType="System.Decimal" HeaderText="Taksit Tutarı"
                                SortExpression="TAKSIT_TUTAR" UniqueName="TAKSIT_TUTAR" DataFormatString="{0:###,###.## TL}"
                                FilterImageToolTip="Süz" FilterControlAltText="Filtrele" FilterControlWidth="80%">
                                <HeaderStyle Width="8%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ODEME_DURUMU" HeaderText="Ödeme Durumu" SortExpression="ODEME_DURUMU"
                                UniqueName="ODEME_DURUMU" FilterImageToolTip="Süz" FilterControlAltText="Filtrele"
                                FilterControlWidth="70%">
                                <HeaderStyle Width="10%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="NOTES" HeaderText="Notlar" SortExpression="NOTES"
                                UniqueName="NOTES" FilterImageToolTip="Süz" FilterControlAltText="Filtrele" FilterControlWidth="90%">
                                <HeaderStyle Width="20%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn Text="Sil" CommandName="Delete" ButtonType="ImageButton"
                                ItemStyle-Width="2%" ConfirmText="Bu bilgiyi silmek istediğinizden emin misiniz?"
                                HeaderStyle-Width="2%" HeaderText="Sil">
                                <HeaderStyle Width="2%" HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                                <ItemStyle Width="2%"></ItemStyle>
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings EditColumn-CancelText="İptal" EditColumn-EditText="Düzenle" EditColumn-InsertText="Ekle"
                            EditColumn-UpdateText="Güncelle" ColumnNumber="4" CaptionFormatString="Bilgi Güncelleme Ekranı"
                            EditColumn-ButtonType="ImageButton">
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="ImageButton"
                                EditText="Düzenle" EditFormColumnIndex="0">
                            </EditColumn>
                        </EditFormSettings>
                        <AlternatingItemStyle VerticalAlign="Middle"></AlternatingItemStyle>
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False" CollapseDelay="700" EnableAutoScroll="True"
                        EnableRoundedCorners="True" ViewStateMode="Enabled" Width="100%">
                        <ExpandAnimation Duration="400" Type="OutElastic" />
                        <CollapseAnimation Type="InExpo" />
                    </FilterMenu>
                </telerik:RadGrid>
                <asp:SqlDataSource ID="AdemButce" runat="server" ConnectionString="<%$ ConnectionStrings:WaccooTablolar %>"
                    ProviderName="<%$ ConnectionStrings:WaccooTablolar.ProviderName %>" SelectCommand="SELECT * FROM &quot;ODEME_EKLE_GORUNTULE&quot;">
                </asp:SqlDataSource>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Nov 2012, 05:13 AM
Hi,

You can add a ComboBox to RadGrid in two ways. Either you can use a TemplateColumn in which you can provide custom controls in the column or a GridDropDownColumn which dispalys a drop-down control for each edited cell in the column. Here is the sample code.
aspx:
<telerik:GridDropDownColumn UniqueName="dropdown" DropDownControlType="RadComboBox" DataField="EmployeeID" ListTextField="EmployeeID" ListValueField="EmployeeID" DataSourceID="SqlDataSource2"></telerik:GridDropDownColumn>
<telerik:GridTemplateColumn UniqueName="template" HeaderText="template">
   <ItemTemplate>
     <telerik:RadComboBox runat="server" ID="rcbClaimantStatusCode" Width="100" DataSourceID="SqlDataSource2" DataTextField="LastName" DataValueField="LastName"/>
   </ItemTemplate>
</telerik:GridTemplateColumn>
Also check the following help documentation for more.
Column Types

Thanks,
Shinu.
0
Adem
Top achievements
Rank 1
answered on 15 Nov 2012, 07:40 AM
thank you Shinu!
this really fixed my problem!

Adem.
0
Adem
Top achievements
Rank 1
answered on 22 Nov 2012, 09:01 PM
THANK YOU TELERIK TEAM!!!

again satisfactory answer..


thanks.. it really worked!!!!
Tags
Grid
Asked by
Adem
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Adem
Top achievements
Rank 1
Share this question
or