Hello,
If this post is not relevant please delete it. I am trying to get the data type of a table while filtering. My intention is while user click on filter option it will check whether that column has string if it has string it will show filter option as "Contains" otherwise filter will display the default i.e Is Equals To. Below are my code.
This piece of code is working fine for all tables but in one table (for all column) while i am trying this code it gives a Null reference exceptions. Any suggestion how to debug and where should i look to fix this issue?
private void OnRadGridViewFilterOperatorsLoading(object sender, Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs e)
{
var column = e.Column as GridViewDataColumn;
if (column.DataType.Name == "String") //this returning me null reference exceptions(but few column of this table does have string value) for one table but for rest tables i am getting value
{
e.DefaultOperator1 = Telerik.Windows.Data.FilterOperator.Contains;
e.DefaultOperator2 = Telerik.Windows.Data.FilterOperator.Contains;
}
If this post is not relevant please delete it. I am trying to get the data type of a table while filtering. My intention is while user click on filter option it will check whether that column has string if it has string it will show filter option as "Contains" otherwise filter will display the default i.e Is Equals To. Below are my code.
This piece of code is working fine for all tables but in one table (for all column) while i am trying this code it gives a Null reference exceptions. Any suggestion how to debug and where should i look to fix this issue?
private void OnRadGridViewFilterOperatorsLoading(object sender, Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs e)
{
var column = e.Column as GridViewDataColumn;
if (column.DataType.Name == "String") //this returning me null reference exceptions(but few column of this table does have string value) for one table but for rest tables i am getting value
{
e.DefaultOperator1 = Telerik.Windows.Data.FilterOperator.Contains;
e.DefaultOperator2 = Telerik.Windows.Data.FilterOperator.Contains;
}