Filter textbox

7 posts, 0 answers
  1. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 04 Aug 2011 Link to this post

    Hi all,

    I am applying filter for Radgrid.
    For example, I have an Email column, and the length of its data is so long.
    But the length of filter textbox is still unchanged. It's not good.
    Please see the pic for more detailed.
    Please help me to fix it.

    Thanks.

    Andy.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Aug 2011 Link to this post

    Hello Andy,

    Try setting the FilterControlWidth as shown below.
    aspx:
    <telerik:GridBoundColumn FilterControlWidth="170px" UniqueName="Email List" HeaderText="Email List"  DataField="Email List">
    </telerik:GridBoundColumn>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 04 Aug 2011 Link to this post

    Hi Princy,

    Thanks for your code.
    But it is just a hard code.
    I would like to make the filter textbox length changes  depends on the data length.

    Thanks.

    Andy.
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2011 Link to this post

    Hello Andy,

    Try the same approach in the following documentation.
    Setting Filter Textbox Dimensions/Changing Default Filter Image.

    Thanks,
    Princy.
  6. Matt DiPietro
    Matt DiPietro avatar
    23 posts
    Member since:
    Nov 2009

    Posted 05 Aug 2011 Link to this post

    I was able to get this to work for auto generated columns by setting the FilterControlWidth in the ItemCreated event

    Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated
        If TypeOf e.Column Is Telerik.Web.UI.GridBoundColumn Then
            Dim boundcol As New Telerik.Web.UI.GridBoundColumn
            boundcol = CType(e.Column, Telerik.Web.UI.GridBoundColumn)
     
            e.Column.FilterControlWidth = Unit.Percentage(85)
        End If
    End Sub
  7. Rakesh Gupta
    Rakesh Gupta avatar
    12 posts
    Member since:
    Oct 2010

    Posted 08 Aug 2011 Link to this post

    Hello,

    You can achieve this by using bellow code.
    <telerik:GridTemplateColumn HeaderText="Email" DataField="Email" SortExpression="Email" UniqueName="Email"   AllowFiltering="true" FilterControlWidth="80%">
         <ItemTemplate>
              <asp:Label runat="server" ID="lblEmail" Text='<%# Eval("Email") %>'></asp:Label>
         </ItemTemplate>    
         <ItemStyle Wrap="False" />
    </telerik:GridTemplateColumn>


    Let me know for any concerns.

    --
    Thanks & Regards,
    Rakesh T. Gupta
  8. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 08 Aug 2011 Link to this post

    Thanks Matt and Rakesh
    Perfect code ^_^

    Andy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017