473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Switch between TextBox and Label inside DataGrid


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
4 4255

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
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
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

Thanks.
Jun 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rodrigo | last post by:
This is what I am doing public class GridCustomPaging : System.Web.UI.Page { protected System.Web.UI.WebControls.DataGrid DgSearch;
1
by: jason | last post by:
I've seen a few posts on this issue, but no clear solutions. I have a mulitiline textbox inside a datagrid. I use TemplateColumn to define as multiline with 3 rows. I have other field types...
2
by: ismaelf | last post by:
i have a textbox in a template column in a datagrid, it displays the initial value of the row, but when i change it remains with the original value (it doesnt get the new value..) i fill the...
0
by: CharlesA | last post by:
Hi folks, I'm using ASP.net 1.1 with C# I've got this kind of thing going <div class="row"> <label class="col1">Rm Name</label> <asp:textbox id="txtRM" runat="server" cssclass="col2"...
1
by: John Smith | last post by:
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??
3
by: rockdale | last post by:
Hi, All: I have a datagrid with TemplateColumn as following: <asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value"...
1
by: sathyan8294 | last post by:
i want to display the name starting with any letter(A-Z,a-z) in textbox from sqldatabase through datagrid using vb.net windows application. for example, values are in datagrid like companyid ...
14
by: subramanian100in | last post by:
Consider the following program: #include <iostream> using namespace std; int main() { int i;
0
KalariaNitya
by: KalariaNitya | last post by:
Hello, could anybody help me? i have gridview, inside gridview i have one Update button & textbox update button update the quantity entered in textbox. i want to update the quantity on textbox on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.