Filter Datetime field with datetimepicker

1 posts, 0 answers
  1. umar
    umar avatar
    10 posts
    Member since:
    Nov 2010

    Posted 12 Jan 2011 Link to this post


    i have used date time field with datepicker now i gets problem in find control .in below code..check code properly and reply as soon as possible.
     <telerik:GridDateTimeColumn  FilterControlWidth="120px" DataField="order_date" HeaderText="ORDER DATE" 
                            UniqueName="order_date" PickerType="DatePicker" DataFormatString="{0:D}" SortExpression="order_date" AllowFiltering ="true">
                            <HeaderStyle Width="160px" />



     if (filterPair.First.ToString() == "EqualTo")
                {
                                       string colName = filterPair.Second.ToString();
                 //Here i gets problem--->       TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
                        string values = tbPattern.Text;
                        string newFilter = "(([" + filterPair.Second + "] =" + values + "))";
                        DataTable dt = new DataTable();
                        dt = Session["dt"] as DataTable;
                        DataTable dtNew = new DataTable();
                        dtNew.Columns.Add("order_id");
                        dtNew.Columns.Add("order_date");
                        dtNew.Columns.Add("items_selected");
                        dtNew.Columns.Add("total_amount");
                        dtNew.Columns.Add("order_description");
                        dtNew.Columns.Add("username");
                        dtNew.Columns.Add("status");
                        DataRow row;
                        e.Canceled = true;
Back to Top