How to use FilterCheckList from another datasource than grid's

2 posts, 0 answers
  1. Software
    Software avatar
    1 posts
    Member since:
    May 2019

    Posted 19 Oct 2019 Link to this post

     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!

  2. Eyup
    Admin
    Eyup avatar
    3892 posts

    Posted 23 Oct 2019 Link to this post

    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.
Back to Top