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 |