.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

GridView TextBox onblur

Posted By:      Posted Date: October 09, 2010    Points: 0   Category :ASP.Net

I have an ASP.NET GridView which has columns that look like this:

Col1   | Col2   | Col3   | Col4   |

In Col3 and Col4 have Template Filed using TextBox Controls 

Is it possible Col3 in TextBox user can  type Text to Display in Col4 TextBox at the time..

View Complete Post

More Related Resource Links

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Textbox in ItemTemplate inside Gridview, unable to get the value


Hi. I have a itemtemplate inside a gridview.

<asp:TemplateField HeaderText="Enter OTP">
                            <asp:Label ID="Label2" runat="server"
                                style="font-family: Arial, Helvetica, sans-serif; font-size: x-small"
                                Text="PIN Num:"></asp:Label>
                            &nbsp;<asp:TextBox ID="txtPIN" runat="server" Height="21px" Width="100px"></asp:TextBox>

jquery datepicker not popping up in Gridview Edit Template textbox


I have a gridview that I can't for the life of me get the datepicker calender to pop up for.  I've been using the datepicker for months very successfully for a variety of textboxes on the page and inside of formviews but this is the first time I've tried using with gridview.  I didn't expect any issues however can't seem to find anything to work.  I have searched the forums for 2 days and attempted any suggestions found within the solutions to no avail.  I've tried using the CSS to link the datepicker but everything stopped working when I changed the code and my page which uses a css style already got all distorted looking.  Please help!

Here is my gridview (only included a part b/c it is large and am only having problem with the datepicker for the date completed text box)

<asp:GridView ID="GridViewCompleted" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid"
        BorderWidth="3px" CellPadding="4" DataKeyNames="job_id" DataSourceID="SourceJobProjectCompleted"
        ForeColor="Black" CellSpacing="2">

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

Changing a textbox's readonly property right before update on a gridview


I have a gridview with a date field. I don't want the user to be able to type in their own date and mess up the format so I made the property readonly. That date is then set by a point and click interface. This is all working fine but when the user clicks update this field doesn't update because it's readonly. If i turn readonly off it works so is there a way to turn off the readonly property right before submit?

How can i add a textbox into a GridView Cell dynamically and how can i retrieve entred data

Hey, i think that the the subject can explain what i need, it's about adding a TextBox control with the code behind into a GridView, and also about how can i retrieve entered data after submitting, im using C#,Thanks.

how to add textbox dynamically in a gridview

i have to create several textbox inside a gridview with its textboxid unique. can anyone tell me how to achieve this with a code in Asp.net 2.0 ?

Value into Textbox of GridView Edit

Hi there, I am not sure this can be done, and if not I am looking for an alternative. Before I start I am using VB.Net and ASP.Net.What I would like to do, is when the edit button is pressed on a Gridview row, I want the TextBox under the ClockOut column, to automatically have the selected value of a dropdown list at the top of the page. Basically so a list of users times will come up in the grid view, and as a fast way to insert a clock out time, the user will have to change the drop down list at the top of the ASP.Net page to the clock out time they want, then when pressing Edit on the row, the time from the Dropdown list will be in the ClockOut textbox, and pressing update will post this. Any help will be great! Thanks, Hope it can be done.

How to fetch data from textbox dynamically in a gridview

How to fetch data from textbox inside a gridview

gridview filtering using a codebehind (textbox + search button)

i am trying to replicate the following sequence: input text into text box > press search button > search a database using LIKE operator > display using a gridview or listview. this sequence is fairly easy to do using the drag and drop then sqldatasource options, but i am trying to do the same result using a codebehind.  here is my code:   ____________________________________________________________________________________________________________ SqlConnection myConn; myConn = new SqlConnection(@"Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\projectDB.mdf; Integrated Security=True;User Instance=True"); myConn.Open(); string strSQL; strSQL = "SELECT * FROM Message";       //strSQL = "SELECT * FROM Message WHERE Message LIKE '" + txtSearch.Text + "'"; SqlDataAdapter da = new SqlDataAdapter(strSQL, myConn); DataSet ds = new DataSet(); da.Fill(ds, "Message"); GridView1.DataSource = ds; GridView1.DataBind(); myConn.Close(); _____________________________________________________________________________________________________________  now, if I use this code inside a page_load event, it does work. if I put it inside a button_click event i get nothing. i am mystified by this.. any help? why can't i use a button to display my gridview1 when i'm using a code behind.  

Alert popup on Gridview Textbox Click

Hi,I am trying to make a Javascript Alert appear when someone clicks on a textbox that is part of a Gridview. the textbox is an Item template and I have an onclick="NotePopup()" in the TextBox properties. I am having trouble grabbing the correct ID of the text box, because it is nested inside a gridview. I have been looking around on Google for a solution but none of the responses are working for me.  The gridview will have multiple rows, so each textbox that could potentially be clicked will have a different ID, is there any way to pass the correct ID to the Javascript, or have the Javascript function grab the correct ID?I did use var Control = '<%= GridView1.ClientID %>';then cut and paste the ID from ViewSource of a textbox and append it to the Control Variable,  to test out the popup and it does workThanks for your helpChris

binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

Multiline textbox help - Gridview

Hi, I have a gridview connected to a SQL datasource. I have in the gridview one column as text and displays more than 6000 characters. How do I display this column as a multitext display, allowing the user to scroll-down in a fixed column grid? Thanks in advance. Nijojo.

keep values in textbox in gridview whilst paging

Hi,   I have a gridview in my webpage which has paging enabled. There are around 5 textboxes in a row and when I enter some text and then move to another page and move back to the page I entered the values in, they are not lost. I have enabled the viewstate in the gridview. I have implemented a datatable to my grid which should hold the values in the viewstate. This worked before I added paging. Please can someone offer some advice as to how I can maintain the values in textboxes whilst moving between different pages? I have tried searching it but I can't seem to find any relevant info.   Thank you very much.

Textbox in headertemplate gridview lost text in updatepanel

Hi everybody,I never post on this forum because since I write code in asp.net I always solve issues by finding solutions with other members who have the problem before me. But this time I don't know how to do...This is my problem : I have a gridview inside an updatepanel and i modified some headers in order to filter the collection. This worked but when my updatepanel is updating, my textbox for the filter clear the value (the text) and lost focus.Is there any solution ?This is my code : <asp:UpdatePanel ID="UpdatePanelOrders" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btFilterClear" /> </Triggers> <ContentTemplate> <asp:GridView ID="OrdersView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" ShowHeaderWhenEmpty="True" EnablePersistedSelection="True" PagerStyle-CssClass="pager" AlternatingRowStyle-CssClass="alter_row" SelectedRowStyle-CssClass="select_row" DataKeyNames="CustId,SalesOrders,CompCode,CustPO"> <Columns>

Textbox -> value -> gridview -> Sqldatasource?

Hi guys. I have textbox that searches for first or last name. Result show in gridview. But when add value in text box and push my button Find nothing happen. Here code: aspx:   ........ <asp:GridView runat="server" AllowPaging="True"                   AutoGenerateColumns="False" DataKeyNames="MobileNum"                   DataSourceID="SqlDataSource5" style="font-family: Verdana"                          onselectedindexchanged="GridView1_SelectedIndexChanged">         <Columns>                         <asp:BoundField DataField="FNAME" HeaderText="FNAME" SortExpression="FNAME" />             <asp:BoundField DataField="LNAME" HeaderText="LNAME" SortExpression="LNAME" />          &nb
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend