By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

Switch between TextBox and Label inside DataGrid

P: n/a

I have DataGrid with Label in one of its columns. Label should change into
TextBox, when user do some specific action. How can I acomplish this??
P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
because my OE news reader doesn't show all my posts.
Jun 6 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

I'm trying this:

<asp:TemplateColumn HeaderText="Sum">
<ItemTemplate>
<asp:Label id="lblSum" runat="server" Text='<%#
Container.DataItem("Sum") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtSum" runat="server" Text='<%#
Container.DataItem("Sum") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>

but when I do this:

DataGrid1.EditItemIndex = index

all DataGrid fields in selected row becomes editable and I wan't only one
specific field to be editable (TextBox). What should I do? :(
Jun 6 '06 #2

P: n/a
You need to make an ItemTemplate including both the label and the textbox
and control their visibility depending
on user actions. For an experienced javascript programmer I would recommend
doing it on client side. Otherwise you can do it on server side, possibly
with AJAX or other similar technologies.

Eliyahu
"John Smith" <jo********@microsoft.com> wrote in message
news:gc********************@news.siol.net...

I have DataGrid with Label in one of its columns. Label should change into
TextBox, when user do some specific action. How can I acomplish this??
P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
because my OE news reader doesn't show all my posts.

Jun 6 '06 #3

P: n/a
Hi,

I think you want to edit values by switching between label and textbox. The
following link would be very helpful.

http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q391q

Thanks
Sharmila

"John Smith" <jo********@microsoft.com> wrote in message
news:gc********************@news.siol.net...

I have DataGrid with Label in one of its columns. Label should change into
TextBox, when user do some specific action. How can I acomplish this??
P.S. Sorry for multiple posts in the same newsgroup, but I had to do that,
because my OE news reader doesn't show all my posts.

Jun 19 '06 #4

P: n/a

Thanks.
Jun 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.