private void button2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox2.Text))
{
MessageBox.Show("Enter something first!");
textBox2.Focus();
return;
}
var fi = new FilterOptions((string)listBox2.SelectedItem, (ComparisonType)comboBox3.SelectedItem, textBox2.Text);
var dt = m_mainForm.DataTable;
var col = dt.Columns[fi.Column];
try
{
if (col.DataType.IsPrimitive && col.DataType != typeof(float) && col.DataType != typeof(double))
if (fi.Value.StartsWith("0x", true, CultureInfo.InvariantCulture))
fi.Value = Convert.ToUInt64(fi.Value, 16).ToString(CultureInfo.InvariantCulture);
Convert.ChangeType(fi.Value, col.DataType, CultureInfo.InvariantCulture);
}
catch
{
MessageBox.Show("Invalid filter!");
return;
}
listBox1.Items.Add(fi);
}