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

hide and display in Edit mode in RadGrid

6 Answers 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Esperanza Ramos
Top achievements
Rank 1
Esperanza Ramos asked on 18 Apr 2008, 02:26 PM
Hi, All:

I have a question.  Under normal mode, I need to hide a column; but in Edit mode, I have to display the column for editing.  Please help.

here is a portion of RadGrid:

<rad:GridTemplateColumn HeaderText="Billed" >
<EditItemTemplate>
<asp:TextBox ID="tbBilled" runat="server" Text='<%# Bind("Billed", "{0:MM/dd/yyyy}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblBilled" runat="server" Text='<%# Bind("Billed", "{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>
</rad:GridTemplateColumn>

Stanley Huang

6 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 18 Apr 2008, 02:47 PM
I believe you want to drop the

<ItemTemplate>
<asp:Label ID="lblBilled" runat="server" Text='<%# Bind("Billed", "{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>


from your code block.

Brandon


0
Esperanza Ramos
Top achievements
Rank 1
answered on 18 Apr 2008, 05:20 PM
Hi,

I have tried to remove <ItemTemplate> section, it did not work as expected.
Because its header is still displaying.

<

rad:GridTemplateColumn HeaderText="Billed">
<EditItemTemplate>
<asp:TextBox ID="tbBilled" runat="server" Text='<%# Bind("Billed", "{0:MM/dd/yyyy}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblBilled" runat="server" Text='<%# Bind("Billed", "{0:MM/dd/yyyy}") %>'></asp:Label>
</ItemTemplate>
</rad:GridTemplateColumn>

In normail mode, I want to hide the entire column "Billed";  In Edit mode,
I want to display this column for editing.

Please help.

Stanley Huang

0
Brandon
Top achievements
Rank 1
answered on 18 Apr 2008, 05:23 PM
Try

<rad:GridTemplateColumn HeaderText="Billed" display="false">

Brandon

0
Esperanza Ramos
Top achievements
Rank 1
answered on 18 Apr 2008, 05:33 PM
Hi,

thanks for your help.

However, setting:<rad:GridTemplateColumn HeaderText="Billed" display="false">

how to display this column in Edit mode.

I want to display this column in edit mode.  But in normal mode, hide this column.

thanks.

Stanley
0
Brandon
Top achievements
Rank 1
answered on 21 Apr 2008, 05:51 PM
Hi Stanley,

Did you figure this out? I'm 'bumping' for you as I see there isn't an answer on the bottom and I'm out of ideas. I actually use web controls to accomplish what you're looking for and only messed around with the templates for a few minutes before jumping into controls.

Hope you find your solution!
Brandon
0
Shinu
Top achievements
Rank 1
answered on 25 Apr 2008, 10:32 AM
Hi Stanley,

Try setting the Visible  property of the TemplateColumn to false to hide the Column in the Normal mode and display it in the Edit mode.

ASPX:
<rad:GridTemplateColumn  Visible="false"  > 


Thanks
Shinu.

Tags
Grid
Asked by
Esperanza Ramos
Top achievements
Rank 1
Answers by
Brandon
Top achievements
Rank 1
Esperanza Ramos
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or