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

[Solved] How to capture RadCombo Selected Items from Multicolumn RadCombo…….

2 Answers 142 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ranganath
Top achievements
Rank 1
Ranganath asked on 28 May 2009, 07:20 AM

Here is the Peace of code which I am using…

<telerik:RadComboBox ID="rcRFQRef" runat="server" Height="190px" Width="153px" HighlightTemplatedItems="true" MarkFirstMatch="true" EnableLoadOnDemand="true" DataTextField="RFQNo" DataValueField="RFQNo" DropDownWidth="420" OnPreRender="rcRFQRef_PreRender" CssClass="RadComboBox_Default" AutoPostBack="True" OnSelectedIndexChanged="rcRFQRef_SelectedIndexChanged" onitemcreated="rcRFQRef_ItemCreated" onitemdatabound="rcRFQRef_ItemDataBound">

<HeaderTemplate>

 <table style="width: 200px" cellspacing="0" cellpadding="0">

  <tr>

<td style="width: 150px;"> Agent Name</td>

<td style="width: 150px;"> RFQ No</td>

</tr>

</table>

</HeaderTemplate>

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

<ItemTemplate>

<table style="width: 350px" cellspacing="0" cellpadding="0">

<tr>

<td style="width: 150px;">

 <div><%# DataBinder.Eval(Container.DataItem, "Agent_Name")%>

</div>

</td>

<td style="width: 150px;">

 <div>

<%# DataBinder.Eval(Container.DataItem, "RFQNo")%>

</div></td>

</tr>

</table>

</ItemTemplate>

</telerik:RadComboBox>

In the “rcRFQRef_SelectedIndexChanged” Event I want to capture the AgentName along with RFQ NO.

Please help me in this regards…

Note:- I don’t want to cahange any Value/Text Field property.

Waiting for response…

Regards,Ranganath.

 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 May 2009, 10:55 AM
Hi Ranganath,

You can add custom Attribute of RadComboBoxItem in order to store the 'Agent_Name', so that you can retrieve the value in SelectedIndexChanged event.

CS:
 
protected void rcRFQRef_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)  
{  
    DataRowView dataSourceRow = (DataRowView)e.Item.DataItem;  
    //set custom attributes from the datasource:  
    e.Item.Attributes["Agent_Name"] = dataSourceRow["Agent_Name"].ToString();  
}  
  
protected void rcRFQRef_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
    String ID = e.Text;  
    String Agent_Name = rcRFQRef.SelectedItem.Attributes["Agent_Name"];  
    Response.Write("You have selected " + ID + " with Name "+ Agent_Name);  
}  

Shinu.
0
Ranganath
Top achievements
Rank 1
answered on 29 May 2009, 06:47 AM
Thanks alot for solution...

Thanks,
Ranganath
Tags
ComboBox
Asked by
Ranganath
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ranganath
Top achievements
Rank 1
Share this question
or