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

Get multiple columns value on selected index change events

1 Answer 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
kd
Top achievements
Rank 1
kd asked on 18 Oct 2012, 01:38 PM
Hi all,

i bound radcombo box with data table and my datatable return three columns but i want to get value of third column on selected index change event and not throught its properties like selected value or text but i want to get value using its item template container

Grower field value on selected index change

<

 

 

script language="javascript" type="text/javascript">

 

function ddl_Lookup_clientblur(sender, eventArgs) {

 

var text = sender.get_text();

 

var item = sender.findItemByText(text);

 

var inputElement = sender.get_inputDomElement();

 

if (!item)

sender.clearSelection();

}

</

 

 

script>

<%

 

--OnClientBlur="ddl_Lookup_clientblur" --%>

 

<asp:HiddenField ID="hidSourceid" runat="server" />

 

<telerik:RadComboBox ID="ddl_Lookup" runat="server" DropDownWidth="400px"

 

ItemsPerRequest="25" EnableLoadOnDemand="true" Width="324px" MarkFirstMatch="true"

 

EnableViewState="true" HighlightTemplatedItems="true" AllowCustomText="true"

 

EnableItemCaching="true" ShowMoreResultsBox="true"

 

ItemRequestTimeout="250" EnableVirtualScrolling="true"

 

DataTextField="IndentNo" DataValueField="IndentNo" OnItemsRequested="ddl_Lookup_ItemsRequested"

 

OnItemDataBound="ddl_Lookup_ItemDataBound" EmptyMessage="Please select IndentNo."

 

OnClientBlur="ddl_Lookup_clientblur"

 

onselectedindexchanged="ddl_Lookup_SelectedIndexChanged">

 

<HeaderTemplate>

 

<ul>

 

<li class="col1">Indent No.</li>

 

<li class="col1">Date</li>

<%

 

-- <li class="col1">GrowerType</li>--%>

 

<li class="col1">Grower</li>

 

</ul>

 

</HeaderTemplate>

 

<ItemTemplate>

 

<ul>

 

<li class="col1">

<%

 

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

 

</li>

 

<li class="col1">

<%

 

# DataBinder.Eval(Container.DataItem, "IndentDate", "{0:" + ConfigurationManager.AppSettings["LongDatePattern"].ToString() + "}")%></li>

<%

 

-- <li class="col1">

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

</li>--

 

 

%>

 

<li class="col1">

<%

 

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

 

</li>

 

<%

 

-- <li class="col1">

<%# DataBinder.Eval(Container.DataItem, "DocumentDate", "{0:" + ConfigurationManager.AppSettings["LongDatePattern"].ToString() + "}")%></li>--

 

 

%>

 

</ul>

 

</ItemTemplate>

</

 

 

telerik:RadComboBox>

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 23 Oct 2012, 11:21 AM
Hi Khalid,

By design the DataItem is available only during databinding.
I could suggest you to use the RadComboBoxItem Attributes.
The Attributes collection lets you store any number of item attributes as name / value pairs - and you can easily obtain the desired value at SelectedIndexChanged event handler.

All the best,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
kd
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or