开发者

how can i check and change the Text Of the DataBound column of My telerik RadGrid?

开发者 https://www.devze.com 2023-01-16 05:44 出处:网络
in my rad grid i have a boundColumn(sy开发者_如何学JAVAstem.string) that i want to change it\'s null value to another customize text...

in my rad grid i have a boundColumn(sy开发者_如何学JAVAstem.string) that i want to change it's null value to another customize text...

how can i check and change the Text Of the DataBound column of My telerik RadGrid?

thanks for your future answer


this was my answer :

protected void grd_ItemDataBound(object sender, GridItemEventArgs e)
{

    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;

        //if (string.IsNullOrEmpty(dataItem["Test"].Text))
        if(dataItem["Test"].Text == " ")
        {
            dataItem["Test"].Text = "Empty";
            dataItem["Test"].ForeColor = ColorTranslator.FromHtml("#006E6E");
        }
    }

}


You can simply use the GridBoundColumn.EmptyDataText property.


If you are using gridview in the bound column there is a property called "NullDisplayText". You can make use of this for displaying different text in place of Null.

0

精彩评论

暂无评论...
验证码 换一张
取 消