i would like to filter a datatable by a column which contains number data, i'm trying the following:
string selected = colSelect.GetItemText(colSelect.SelectedItem);
if (filterText.Text.Length == 0)
{
data_table.DefaultView.RowFilter = string.Empty;
}
else
{
data_table.DefaultView.RowFilter = string.Format("Price Like '%{0}%'", filterText.Text);
I've tried casting the second value to a string but no luck, i get the error:
Cannot perform 'Like' operation on System.Decimal and System.String
The data entered would be any number or text, but based on the data only relevant number values would show with the filter.