This is a migrated thread and some comments may be shown as answers.

DEfault value for gridboundcolumn

2 Answers 312 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vitaly
Top achievements
Rank 1
Iron
Iron
Vitaly asked on 09 Jan 2013, 05:33 PM
Hi guys,
I have a gridboundcolumn:

<

 

 

telerik:GridBoundColumn HeaderText="Location" DataField="LOCATION" UniqueName="LOCATION" ReadOnly="true" SortExpression="LOCATION" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 


I want to put some default value in html to show users how data will look like in the grid.For example:

<

 

 

telerik:GridBoundColumn HeaderText="Location" DataField="LOCATION" UniqueName="LOCATION" ReadOnly="true">31R050</telerik:GridBoundColumn>

Thanks so much for your help.

2 Answers, 1 is accepted

Sort by
0
Elliott
Top achievements
Rank 2
answered on 09 Jan 2013, 06:51 PM
since it is a bound column i.e. bound to the data source, it is there the default should be introduced
0
Shinu
Top achievements
Rank 2
answered on 10 Jan 2013, 06:32 AM
Hi,

One suggestion is that you can add a Label along with the BoundColumn as shown below.
C#:
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
{
   if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        Label lbl = new Label();
        lbl.Text = "some text";
        item["LOCATION"].Controls.Add(lbl);
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Vitaly
Top achievements
Rank 1
Iron
Iron
Answers by
Elliott
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or