What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 52345 |  Welcome, Guest!   Register  Login
 Home > Forums > Ask Interview Questions > How to get and edit textbox values in grid? ...
Kk86kiran

How to get and edit textbox values in grid?

Replies: 16 | Posted by: Kk86kiran on 4/19/2012 | Category: Ask Interview Questions Forums | Views: 1946 | Status: [Member] | Points: 10  


Hi, Yesterday i have attend for one interview in that he gave me one task i.e, 2 textboxes are available and save button. In update panel i have one grid control. Now my task is if you any values in text boxes those will be displayed in grid and edit option also will work for that but save button will be out side the update panel. I tried but i did not get that. So can one clear my doubt?

k.m.j.kiran


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

GSM_GSV
GSM_GSV  
Posted on: 4/19/2012 11:52:43 PM
Level: Starter | Status: [Member] | Points: 25

Do you want to display the contents of your textboxes in gridview upon clicking save button?

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/19/2012 11:52:58 PM
Level: Starter | Status: [Member] | Points: 25

I recommend you to please post the code that you have attempted.

____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sunny4989
Sunny4989  
Posted on: 4/19/2012 11:59:25 PM
Level: Starter | Status: [Member] | Points: 25

Can u please extend your question details more clearly???

------------------------------------------------
Learn throughout life

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/20/2012 12:35:38 AM
Level: Starter | Status: [Member] | Points: 25

I have one solution.

Use an xml file. Editing an xml file will be easy affiar.
bind it to the grid view.


____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/20/2012 12:37:57 AM
Level: Starter | Status: [Member] | Points: 25

http://www.w3schools.com/xsl/xsl_editxml.asp

____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/20/2012 12:41:48 AM
Level: Starter | Status: [Member] | Points: 25

http://forums.asp.net/t/983488.aspx

This will help you in making the grid view editable

____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sunny4989
Sunny4989  
Posted on: 4/20/2012 12:43:41 AM
Level: Starter | Status: [Member] | Points: 25

@ DotnetRajanikanth

XML file is no need

------------------------------------------------
Learn throughout life

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Kk86kiran
Kk86kiran  
Posted on: 4/20/2012 3:05:53 AM
Level: Starter | Status: [Member] | Points: 25

2 text boxes available and one save button. In Update Panel i have one gridview. If enter any values in those text boxes those values will be displayed in the grid after clicking save button. In this button and text boxes are placed out side the update panel. Only grid in update panel. Edit also work in grid ?



k.m.j.kiran

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/20/2012 3:10:21 AM
Level: Starter | Status: [Member] | Points: 25

@Sunny4989

I suggested it as an alternative of database

____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/20/2012 3:11:36 AM
Level: Starter | Status: [Member] | Points: 25

@Kk86kiran

Editing can be performed in grid view. I have posted a link for that above reffer it.

____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Kk86kiran
Kk86kiran  
Posted on: 4/20/2012 3:14:02 AM
Level: Starter | Status: [Member] | Points: 25

I know how to edit a grid but i want to invoke a trigger in button from out side of the update panel.

k.m.j.kiran

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dotnetrajanikanth
Dotnetrajanikanth  
Posted on: 4/20/2012 3:23:12 AM
Level: Starter | Status: [Member] | Points: 25

Use AsyncPostBackTrigger inside the trigger in update panel.

<body>

<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:Label ID="Label1" runat="server" Text="Panel created."></asp:Label><br />
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>

</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>


Refer this link also...

http://msdn.microsoft.com/en-us/library/bb399001.aspx In this link read the section Refreshing an UpdatePanel Control with an External Button

Hope this will help you

____________
www.flickr.com/photos/psdesigner/

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sunny4989
Sunny4989  
Posted on: 4/20/2012 7:12:25 AM
Level: Starter | Status: [Member] | Points: 25

Hi kiran

Edit also work in grid ? ]]


What does it mean

------------------------------------------------
Learn throughout life

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Dhiren.Kaunar@Gmail.Com
Dhiren.Kaunar@Gmail.Com  
Posted on: 4/20/2012 1:06:54 PM
Level: Starter | Status: [Member] | Points: 25

Hi Kiran,

As I have understood : On click of button you want to display text boxes values in the the grid with edit option . But save button is out side the update panel.

If that is the problem . then we can call the trigger event of panel which has grid and we will update grid columns.

Otherwize Could you please elaborate your problem little more.

Thanks & Rgards,
Dhiren Kumar Kaunar

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Ravianand
Ravianand  
Posted on: 5/12/2012 1:35:59 AM
Level: Starter | Status: [Member] | Points: 25

Can u please extend your question details more clearly???

Regards,
Ravi

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Meet1424
Meet1424  
Posted on: 5/12/2012 2:12:56 AM
Level: Starter | Status: [Member] | Points: 25

Hi, try this on button click !
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Value", typeof(string)));
DataRow dr = dt.NewRow();
dr["Value"] = txtData.Text;
dt.Rows.Add(dr);
gvData.DataSource = dt;
gvData.DataBind();

I took a gridview inside updatepanel and one textbox and a button outside the updatepanel, when i input anything in textbox and click the button it binds the same input to gridview. I did not add any trigger for update panel and its working

Kk86kiran, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 9:28:14 AM