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();
                        DataRow row;
                        e.Canceled = true;
Back to Top