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

How to use FilterCheckList from another datasource than grid's

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 20 Oct 2019, 04:42 AM

 have a RadGrid which has a main data source dsA. I have a foreign key column on this dsA called fColumn having integer values, on which I am getting the relevant text of this fColumn from a second table "tblB". The tblB has two columns (id and text) which the id is corresponding to fColumn.
I want to have the FilterCheckList values in the grid from this tblB, column named "text" which I did as:

<telerik:GridBoundColumn DataField="fColumn" FilterCheckListEnableLoadOnDemand="true"
                HeaderText="HeaderTxt" SortExpression="fColumn" UniqueName="fColumn">        
 </telerik:GridBoundColumn>

 

and in the code.cs file:

protected void RadGrid1_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
 {
            string DataField = (e.Column as IGridDataColumn).GetActiveDataField();
            e.ListBox.DataSource = dsTblB;
            e.ListBox.DataKeyField = "id";
            e.ListBox.DataTextField = "text";
            e.ListBox.DataValueField = "id";
            e.ListBox.DataBind();
 }

 

What I am getting as error in alert when I am clicking on this filter:
fColumn is neither a DataColumn nor a DataRelation for table DefaultView.

So how this above scenario can be easily achieved with Telerik controls.

PS: I don't want to use SQL Joins for filling the Grid in the query.
Thanks in Advance!

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 23 Oct 2019, 10:01 AM

Hi,

I've already replied to your query in your formal support thread. I suggest that we continue our technical discussion there if the issue is still present.

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Software
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or