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

[Solved] Setting the controlparameter of a ListBox which points to same RadGrid where the Listbox is used

1 Answer 209 Views
Grid
This is a migrated thread and some comments may be shown as answers.
N S
Top achievements
Rank 1
N S asked on 03 Sep 2009, 12:38 PM
I'm having trouble with the controlparameter of a ListBox which points to same RadGrid where the Listbox is used.

I want to populate the Listbox depending on the selected value of the Grid, so I've set a controlparameter in the datasource of the ListBox which points to the selectedItem of the Grid. However, the controlparameter always gets the default value. If I set the controlparameter to another grid (not the grid which is the parent of the ListBox) it works fine.

<GRID id=g1 Datasource = DS1>  
    <VIEW> 
    <EDIT> 
        <LISTBOX Datasource=DS2></LISTBOX> 
      </EDIT> 
</GRID> 
 
<DS1> 
    ...  
</DS1> 
 
<DS2> 
    <selectparameters> 
        <asp:ControlParameter ControlID="g1" DefaultValue="0" Name="id" PropertyName="SelectedValue" Type="Int32" />   
    </selectparameters> 
</ds2> 


1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 08 Sep 2009, 07:06 AM
Hello N S,

Thank you for contacting us and for your question.
You can employ a setup close to the one shown in this example:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx

You can also allow the postback on row click, to make sure the page posts back, and the listview is properly updated.
Give this option a try and let me know how it goes and if any other questions arise.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
N S
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or