Emad Ahmed

Emad Ahmed

  • NA
  • 62
  • 2.9k

Filter int32 filed in RadGridView according to textbox

Jan 18 2017 2:30 PM
I have a main form frmInnovation that contains a textbox txtInnovationID, and I have a Telerik RadGridView on the form TableSituations with a column InnovationNameID of type int32.
What I want to do is to filter the RadGridView on form load according to the txtInnovationID.

TableSituation.InnovationNameID = txtInnovationID

I use this code to filter strings, but how to modify to filter int32.
  1. BindingSource bs = new BindingSource();  
  2. bs.DataSource = TableSituations.DataSource;  
  3. bs.Filter = TableSituations.Columns[2].HeaderText.ToString() + " LIKE '%" + txtInnovationID.Text + "%'";  
  4. TableSituations.DataSource = bs.DataSource; 
 I need also to change the code from "LIKE" to "Equals".

Answers (2)