473,516 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add New Row into grid view using javascript.

3 New Member
Hi All,

I need one solution.

I have list box and grid view on screen. I want to add selected item of list box into grid view as row. Using javascript.

Can we do this?
Is any alternative to implement this without post back and without ajax?

Can we do this by creating html table ? if yes then let me know hint.

Thank you
Jayraj Todkar.
Apr 23 '09 #1
3 6657
Frinavale
9,735 Recognized Expert Moderator Expert
It would be easier to do this without using JavaScript simply because you're dealing with .NET controls.

You can implement it so that the ListBox has AutoPostback = "true". Whenever the selected index of the ListBox changes it will post back to the server.

You can handle the ListBox's SelectedIndexChanged event in your code and implement it in such a way that it adds a row to the GridView.
Apr 23 '09 #2
amitjain123
3 New Member
Hey,

Appreciate your quick response to this problem.I am sure It will definitely help to resolve the problem. But I have a constraint here. I need to implement the functionality without any post back or without using AJAX.
Is there any way to achieve it without postback ?

Many thanks
Jayraj.
Apr 24 '09 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Sure there's a way to do this.
I would recommend running your application to see how the ListBox is rendered in the browser (I believe it's a <select>). Once you know this you'll have to develop your JavaScript methods to add the selected items to the GridView (that's rendered as a <table>).
Apr 27 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2475
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to have a separate data adapter & a separate data set for each select query? If thats possible then how?
12
2366
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that field... This grid displayes results based on users search.. public static int numberDiv; private void Page_Load(object sender, System.EventArgs e) {
6
1555
by: Kate | last post by:
Hi, we are now developing complex business application using Ajax framework. Could anyone point me to the editable javascript grid control which supports XML loading. Good javascript API would be a plus. And rather important thing - sometimes we need to represent hierarchically structured data, so tree view is a must. In most grid controls I...
0
2056
by: ¿ Mahesh Kumar | last post by:
I have created a XML file as datasource which i 'm binding to a grid view control. During runtime I'm capturing items in XML file and displaying in a GRID VIEW control. but i want to remove or flush the XML file content on page load. I tried parentnode.removeall () but no use.. (1) how to clean/delete the XML file nodes on page load for...
2
3610
by: Jasmine | last post by:
Hi, how can I set up the javascript for the button field in the grid view, so that when the user click the button, a pop up window will be opened, I mean where could I add the "window.open "url" script for the buttion? Thanks
0
2382
by: weiwei | last post by:
Hi; I am having trouble to get variable from grid view. here is my scenario. I want to delete a row in database from web page, in additon, I also want to delete that user's directory in c:drive. so far, I can only finished the first part which is to delete the row from database, Please see below code where I want to get variable in order to...
2
4071
by: probashi | last post by:
Hi, Using the SqlDataSource/SelectParameters/ControlParameter one can easily bind a Grid View with a list box (or any other controls), pretty cool, but my list box is multi select. My questions is, how can I bind a Grid View Control to a multi select list box (or any multi values controls) Thanks
2
3840
by: Umeshnath | last post by:
Hi, I have placed a grid view inside Atlas panel. On click of a button event, data is populated in the grid view, I want to add scroll bar instead of increasing the size of grid view. I have written the following code. <div id="Layer1" style="width:350px; height:140px; z-index:1;overflow-y: scroll"> But the problem was scroll bar will...
1
4972
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have a Grid View and I want to expoet into Excel. I am using a hyperlink to export the GridView intop Excel. But when I click on link it just shows me java script. It doesn't open Excel sheet. Here is my Code. In HTML <p><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="javascript:alert('Unable to process...
0
7276
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.