How to get the column type of a column of radgrid in javascript ?
I need to remove few filter options for 'GridDateTimeColumn'.
So I need to get the column type of the column in 'On Client Showing' event.
Any other way to acheive the same would be appreciated.
Thank you,
Anurag
3 Answers, 1 is accepted
0
Konstantin Dikov
Telerik team
answered on 25 Sep 2014, 06:34 AM
Hello Anurag,
Once you get reference to a specific column you can use the following approach for retrieving its type:
var someColumn = grid.get_masterTableView().getColumnByUniqueName("Id");
var columnType = someColumn._data.ColumnType;
}
</script>
</telerik:RadCodeBlock>
As for reducing filter options, please take a look at the following help article, where in the first part in the JavaScript tab you can see how this could be accomplished, depending on a condition:
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
This works fine. Thank you.
But I am facing another issue with filtering datetimecolumn. I am changing the format to dd-MMM-yyyy (as required in the database) and sending to stored proc. But donot get any data in the readgrid although the same filter works fine when used in sql server as parameter to that particular stored proc.
Regards,
Anurag
0
Konstantin Dikov
Telerik team
answered on 30 Sep 2014, 08:16 AM
Hello Anurag,
GridDateTimeColumn is designed to be used with DateTime objects only. This means that the DataField set to the column must be of DataTime type. The same applies for the underlying column in the database.
Can you please confirm that you are using DateTime objects?
If you continue to experience problems with this, please provide the markup and the relevant part of your code-behind, so we can familiarize with your exact implementation.
Best Regards,
Konstantin Dikov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.