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

RadComboBox Filter SqlDataSource with where conditions

2 Answers 140 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Subhashini
Top achievements
Rank 1
Subhashini asked on 05 Feb 2016, 04:18 AM

Hi,

I am trying to load a radcombobox filter as below,  the sqldatasource where conditions are coming from session values - session("ssnUSER_NAME") and session("ssnUSER_ID"). //VB.net 4.5/2015Q2/Oracle

The radcombo filter is not getting populated.

What am I missing?

Also a secondary question, I want to display user name but the filter should pickup user_id="some_id". Is it possible?

Any help will be greatly apprerciated. Thanks.

<telerik:GridBoundColumn DataField="USER_NAME" HeaderText="CREATED BY"

SortExpression="USER_NAME" UniqueName="USER_NAME" ReadOnly="true">

<FilterTemplate>

<telerik:RadComboBox RenderMode="Lightweight" ID="rcbUserName" DataSourceID="SqlDataSource5" DataTextField="USER_NAME"

DataValueField="USER_NAME" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("USER_NAME").CurrentFilterValue %>'

runat="server" OnClientSelectedIndexChanged="UserNameIndexChanged">

<Items>

<telerik:RadComboBoxItem Text="All" />

</Items>

</telerik:RadComboBox>

<telerik:RadScriptBlock ID="RadScriptBlock4" runat="server">

<script type="text/javascript">

function UserNameIndexChanged(sender, args) {

var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");

tableView.filter("USER_NAME", args.get_item().get_value(), "EqualTo");

 

}

</script>

</telerik:RadScriptBlock>

</FilterTemplate>

</telerik:GridBoundColumn>

 

 

<asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServicesOracle %>"

ProviderName="<%$ ConnectionStrings:ApplicationServicesOracle.ProviderName %>"

SelectCommand="select distinct b.USER_NAME, b.USER_ID from tblPTS a join tblUSER_DETAILS b on a.USER_ID = b.USER_ID where (b.TEAMLEAD = :ssnUSER_NAME or a.USER_ID = :ssnUSER_ID) and (a.STATUS = 'RECEIVED' or a.STATUS = 'IN PROGRESS')">

<SelectParameters>

<asp:SessionParameter Name="ssnUSER_NAME" SessionField="ssnUSER_NAME" />

<asp:SessionParameter Name="ssnUSER_ID" SessionField="ssnUSER_ID" />

</SelectParameters>

</asp:SqlDataSource>

 

 

 

2 Answers, 1 is accepted

Sort by
0
Subhashini
Top achievements
Rank 1
answered on 05 Feb 2016, 06:36 AM
Nevermind. I used some string functions to make it work. But still searching if there is a simpler straightforward way to do it.
0
Subhashini
Top achievements
Rank 1
answered on 05 Feb 2016, 03:04 PM
I spoke to soon. I replaced the radcombo sql parameter with the session values but it throws ORA-01036: illegal variable name/number.
Tags
ComboBox
Asked by
Subhashini
Top achievements
Rank 1
Answers by
Subhashini
Top achievements
Rank 1
Share this question
or