This is a migrated thread and some comments may be shown as answers.

Filter GridBoundColumn With wep api

3 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bakri
Top achievements
Rank 1
Bakri asked on 05 Apr 2014, 04:35 AM
Hi,
I am trying to filter GridBoundColumn  
I am using web Api as data source Take a Walk on the Client Side with WebAPI and WebForms – Part 2
my grid :
<telerik:RadGrid runat="server" ID="grdUsers" AllowPaging="true" AllowSorting="true"
                                    AllowFilteringByColumn="true" PageSize="5">
                                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="Id" ClientDataKeyNames="Id,FullName,UserName,Email,RegisterationDate">
                                        <PagerStyle Mode="NumericPages" />
                                        <Columns>
                                              <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="CustomerID" AlternateText="User image" DataAlternateTextField="ContactName"
                                                    ImageAlign="Middle" ImageHeight="50px" ImageWidth="50px" AllowFiltering="false" HeaderText="">
                                                </telerik:GridImageColumn>
                                            <telerik:GridBoundColumn  DataField="UserName" HeaderText="User Name"  
                                                  DataType="System.String">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn  DataField="FullName" HeaderText="Name"  
                                                  DataType="System.String">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn  DataField="Email" HeaderText="Email"  
                                                  DataType="System.String">
                                            </telerik:GridBoundColumn>
                                            
                                             <telerik:GridBoundColumn DataField="RegistrationDate" HeaderText="Registration Date"  
                                                   UniqueName= "RegistrationDate" DataFormatString="{0:dd/MM/yyyy}">
                                               </telerik:GridBoundColumn>
                                            <telerik:GridButtonColumn UniqueName="btnEdit"  ButtonType="PushButton" Text="Edit" CommandName="Edit"></telerik:GridButtonColumn>
                                            <telerik:GridButtonColumn UniqueName="btnDelete" ButtonCssClass="del" ButtonType="PushButton" Text="Delete" CommandName="Delete"></telerik:GridButtonColumn>
                                        </Columns>
                                    </MasterTableView>
                                    <ClientSettings>
                                        <Selecting AllowRowSelect="True" />
                                        <ClientEvents OnCommand="RadGridCommand" />
                                        <DataBinding Location="/SecuHostapi/Security/Role/Load_Users"  ResponseType="JSON">
                                            <DataService TableName="SecuHostUser" Type="OData" />
                                        </DataBinding>
                                    </ClientSettings>
                                </telerik:RadGrid>

my data source :    
 public partial class SecuHostUser : IdentityUser
    {
        public string FullName { set; get; }
        public string Email { set; get; }
        public string Image { set; get; }
        public DateTime RegistrationDate { set; get; }
    }
but the result appear with no filtering for  RegistrationDate column 
the result in attachment 

I want to display Just the date

Thanks.


3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 09 Apr 2014, 10:45 AM
Hello Bakri,

In your scenario the column will handle the values as String and not as DateTime objects. For DateTime objects you need to use GridDateTimeColumn.

Please try to use the following column for the RegistrationDate field and see if everything is working correctly with it:
<telerik:GridDateTimeColumn DataField="RegistrationDate" HeaderText="Registration Date"
    UniqueName="RegistrationDate" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime">
</telerik:GridDateTimeColumn>

Hope this helps.


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.

 
0
Bakri
Top achievements
Rank 1
answered on 10 Apr 2014, 07:20 AM
Thanks for replay,
I have tried GridDateTimeColumn but, also the same result 
still no filtering 
0
Konstantin Dikov
Telerik team
answered on 14 Apr 2014, 02:14 PM
Hello Bakri,

Could you please elaborate what do you meant by "still no filtering"? Will the filtering return all the items again or no items at all. 

Additionally, is the filtering fails only for that column or it does not work for the other columns as well.

Finally, if you can open a regular support ticket with sample, runnable project attached, this would help us locate the root of the problem.

I am looking forward to your reply with the details.


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.

 
Tags
Grid
Asked by
Bakri
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Bakri
Top achievements
Rank 1
Share this question
or