Filter textbox sizing

Thread is closed for posting
3 posts, 0 answers
  1. 55ED532C-EDE8-4660-9595-BC8CF6BE8E38
    55ED532C-EDE8-4660-9595-BC8CF6BE8E38 avatar
    1 posts
    Member since:
    Nov 2006

    Posted 03 Jan 2007 Link to this post

    Requirements

    r.a.d.controls version

    Q3 2006

    .NET version

    2.0

    Visual Studio version

    2005

    programming language

    vb.net    

    browser support

    all browsers supported by r.a.d.controls


     
    PROJECT DESCRIPTION
    This project was started to address 2 problems with the method described in the documentation for changing the textbox sizes in the filter row.

    Problem 1:  Needed to specify each column name and create a new textbox variable for each column.

    Problem 2:  If columns exist in the master table, but not in child tables, the documented method will generate an error.

    Solution:  The following Subroutine will cycle through the columns without specifying them - thus reducing code and eliminating potential problems should the columns change or not exist in all tables.

        Protected Sub rgrPurchaseOrders_ItemCreated(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles rgrPurchaseOrders.ItemCreated  
            If TypeOf e.Item Is Telerik.WebControls.GridFilteringItem Then  
                Dim filteringItem As Telerik.WebControls.GridFilteringItem = CType(e.Item, Telerik.WebControls.GridFilteringItem)  
                For Each myCell As Telerik.WebControls.GridTableCell In filteringItem.Controls  
                    If myCell.HasControls Then  
                        For Each myControl As Control In myCell.Controls  
                            If myControl.ToString = "System.Web.UI.WebControls.TextBox" Then  
                                Dim box As TextBox = myControl 
                                box.Width = "60" 
                            End If  
                        Next  
                    End If  
                Next  
            End If  
        End Sub 

     
  2. C7498A83-7E2E-418C-8791-93EF573A7569
    C7498A83-7E2E-418C-8791-93EF573A7569 avatar
    9934 posts
    Member since:
    Nov 2016

    Posted 05 Jan 2007 Link to this post

    Hello Geno,

    Thank you for the post - indeed this will set the filter box dimensions for all grid columns with equal widths. However, if you would like to modify their dimensions differently, you will need to use the approach presented in the topic from the product documentation you have mentioned. Of course, to avoid exception generation in hierarchical grid with filtering enabled in each level, you can distinguish the level in the hierarchy as demonstrated here.

    500 telerik points were added to your account for the feedback.

    Best wishes,
    Stephen
    the telerik team
  3. B4A52C0B-33FA-4ECF-B2A2-BB4FBE1DDCAF
    B4A52C0B-33FA-4ECF-B2A2-BB4FBE1DDCAF avatar
    31 posts
    Member since:
    Oct 2007

    Posted 27 Feb 2008 Link to this post

    The other way to do it is set it in css.

    .GridFilterRow_WebBlue

    input, .GridHeaderDiv_WebBlue input

    {

    width: 60px;

    }

Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.