Telerik Radgrid过滤格式化

时间:2015-03-28 05:24:47

标签: asp.net vb.net filter telerik radgrid

我有一个启用过滤的radgrid,我需要将过滤器设置为“text-transform:uppercase”。如何在vb代码中引用默认过滤器文本框,还是有其他方法可以实现此目的?

1 个答案:

答案 0 :(得分:0)

请尝试使用以下代码段。如果有任何疑虑,请告诉我。

<强> ASPX

<head runat="server">
    <title></title>
    <style type="text/css">
        .RadGrid_Default .rgFilterBox {
            text-transform: uppercase;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
            <telerik:RadScriptBlock ID="scrCode_Outlier" runat="server">
                <script type="text/javascript">

                </script>
            </telerik:RadScriptBlock>
            <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" AllowFilteringByColumn="true">
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView AutoGenerateColumns="false">
                    <Columns>
                        <telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="Name"></telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </form>
</body>

<强> ASPX.VB

Protected Sub RadGrid1_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs)
        Dim data As dynamic = New () {New With { _
            Key .ID = 1, _
            Key .Name = "Name1" _
        }, New With { _
            Key .ID = 2, _
            Key .Name = "Name2" _
        }}
        RadGrid1.DataSource = data
End Sub

根据您的皮肤,请使用默认&#34; RadGrid_Default&#34;替换您的皮肤名称。