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

[Solved] Multiple controls in RadComboBox - Client-side SelectedIndexChanged

1 Answer 199 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rajasekar Nammalvar
Top achievements
Rank 1
Rajasekar Nammalvar asked on 02 Dec 2009, 04:57 PM
Hi
I am using the radcombobox inside the radgrid. While select the radcombobox need to get the container item value in the client side. I can able to get the combobox text & value. But the problem is, I can't get the "Default_StatusENUM" value which is stored in data container.

ASPX:
<telerik:radgrid ID="gvSOComment" runat="server" Width="100%" GridLines="Both" AutoGenerateColumns="False" 
                                AllowSorting="True" ShowStatusBar="true" OnItemCommand="gvSOComment_ItemCommand" 
                                OnItemDataBound="gvSOComment_ItemDataBound"   
                                OnSortCommand="gvSOComment_SortCommand">  
                                <MasterTableView EditMode="InPlace" EnableViewState="true" GroupLoadMode="Client" 
                                    Width="100%" DataKeyNames="WOID, CodeId, Sequence">  
                                    <ItemStyle Width="120px" /> 
                                    <HeaderStyle Width="120px" /> 
                                    <NoRecordsTemplate> 
                                        No Data found.  
                                    </NoRecordsTemplate> 
                                    <Columns> 
                                        <telerik:GridTemplateColumn HeaderText="Comment Type" SortExpression="CodeId" ShowSortIcon="true">  
                                            <ItemTemplate> 
                                                <asp:Label runat="server" ID="lblWorkCode" Width="250px">  
                                                </asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <telerik:RadComboBox ID="cmbWorkCode" runat="server" Width="250px" Height="200px" DataValueField="CodeId" 
                                                    DataTextField="CodeName" SortExpression="CodeName" OnClientSelectedIndexChanged="OnClientSelectedIndexChangedEventHandler">  
                                                    <ItemTemplate> 
                                                    <table><tr>  
                                                    <td><%# DataBinder.Eval(Container.DataItem, "CodeName") %></td>  
                                                    <td><%# DataBinder.Eval(Container.DataItem, "Default_StatusENUM") %></td>  
                                                    </tr></table>  
                                                    </ItemTemplate> 
                                                </telerik:RadComboBox> 
                                            </EditItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                    </Columns> 
                                    <EditFormSettings CaptionFormatString="Edit details for Comments with ID {0}" CaptionDataField="WOID">  
                                        <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle> 
                                        <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle> 
                                        <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle> 
                                    </EditFormSettings> 
                                </MasterTableView> 
                                <ClientSettings> 
                                    <ClientEvents OnColumnClick="ColumnClick" OnGridCreated="GridCreated"></ClientEvents> 
                                </ClientSettings> 
                                <ItemStyle Wrap="True"></ItemStyle> 
                            </telerik:radgrid> 
Java Script:
<script type="text/javascript" 
    function OnClientSelectedIndexChangedEventHandler(sender, eventArgs) {  
        var item = eventArgs.get_item();  
        var dataItem = eventArgs.get_dataItem();  
        alert(dataItem.CodeName);  
        alert(dataItem.Default_StatusENUM);  
    }  
</script> 

Thanks in advance.

Regards,
RAJASEKAR NAMMALVAR

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Dec 2009, 01:59 PM
Rajasekar,

One suggestion will be sing Custom Attributes for saving the third value and get the attribute value in the client side. Checkout the following forum link that shows how to perform this.
Problem with Attribute

-Shinu.
Tags
ComboBox
Asked by
Rajasekar Nammalvar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or