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

how to get value from OnClientSelectedIndexChanging using OnItemsRequested in radgrid

1 Answer 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 09 Mar 2011, 02:23 PM
I have radcombobox into my radgrid. i want selected index changed without post back.

using OnClientSelectedIndexChanging with OnItemsRequested. i got value from db. but it is not assigning into label.

here i attached my code

 <telerik:RadComboBox ID="ddlCoverage" AutoPostBack="false" Width="110px" AppendDataBoundItems="true"
                                                runat="server" OnSelectedIndexChanged="ddlCoverage_IndexChanged"  DataTextField="cvg_typ_code" OnClientSelectedIndexChanged="LoadDdlCvg" OnItemsRequested="ddlCoverage_OnItemsRequested"
                                                DataValueField="pln_cvg_id">                                               
                                            </telerik:RadComboBox>


function LoadDdlCvg(combo, eventArqs) {
                      var item = eventArqs.get_item();
                      $find(combo.get_id()).requestItems(item.get_value(), false);            
                  }

   Protected Sub ddlCoverage_OnItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
        Dim rcCoverage As RadComboBox = DirectCast(sender, RadComboBox)
        Dim l_pln_id, l_pln_cvg_id, ben_EE_amt, ben_ER_amt As Double
        Dim item As GridDataItem = CType(rcCoverage.NamingContainer, GridDataItem)             
            l_pln_cvg_id = e.Text                   
            Dim lblEEContrib As Label = item.FindControl("lblEEContrib")
            Dim lblERContrib As Label = item.FindControl("lblERContrib")             
                lblEEContrib.Text = String.Format("{0:c}", ben_EE_amt)           
                lblERContrib.Text = String.Format("{0:c}", ben_ER_amt)        
       
    End Sub

Bold value comes from db. but it's not assigning into label
Please give me a tips for this is one.

Thanks in advance,
Dhamu.

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 14 Mar 2011, 02:18 PM
Hi Dhamu,

It seems that you are mixing client with server-side events. If you want to load the RadComboBox items on demand on the client, you can consider using a web service for this purpose like shown here:
ADO.NET Service
WCF Web Service

Greetings,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or