Binding gridview with xml file at client side - asp.net

hi i have two xml file and i want to bind grid view eith this xml file on client side. i try to describe the complete senerio. in my .aspx page i have a drop down list which has number of department. when the user select the department the data i want the data according to department comes on the grid view from first xml file, in this gridview the rows are field with various tests and the row also have a checkboxes ,when user click on that checkbox the datafrom yhe second xml file will come and the second grid view is bind with that data. i want all that on client side. how is that possible, please help me and thanks in advance for help

I would suggest you to either use jqgrid/html table and use this article to read xml using javascript or if you wants to use gridview only and don't wants to show post back to the user then use updatepannel with gridview will help you out.

Related

How to show the related data of a gridview in new window/

I am doing a project in which i am getting data from a database and displaying in asp:gridview. i want to show a hyperlink column in which i want to show a proper named hyperlink for example "View" and when the user click on "View" the data from the DataTextField property is displayed in detail on another page let say "WebForm1.aspx".i have searched on net and have studied on msdn bt couldnt get. detailed help will appreciated .. piece of code as example will be helpful . thanks in advance.
Example:
data in the database table
NewsID NewsTitle NewsArticle (NewArticle field contains large amount of data)
i want to show a proper link named("view"). when user click on the view ,NewsArticle of the related record should be displayed in a new separate webpage.
One way to do this is for the hyperlink/url contained in each row of the grid view to contain the id of the record you want to view the detail, i.e.
View
then in the page_load event of the webform1.aspx you retrieve that record from the database and dispaly it on the page.
There are lots of ways to skin this cat, this is a relatively simple one. The code below is what you might use to generated the html above:
<asp:HyperLinkField HeaderText="Name" DataTextField="Id" DataNavigateUrlFields="DetailId" DataNavigateUrlFormatString="WebForm1.aspx?ID={0}">
</asp:HyperLinkField>
If you are familiar with Jquery you can user Dialogs
http://jqueryui.com/dialog/

ASP.Net, how to put hyperlinks in datagrids.

Hi i have a datagrid I've put in on a aspx web form in visual studio 2010, I'm new to this so I've been following the ms tutorials.
One of the columns on my data grid contains a lot of information, is there a way i can add a "+more" option in the cell next to the entry that shows only the first few characters of that cell, but once clicked opens all the information on that particular entry but onto a new aspx form?
Thanks for any help!!
There are basically three different ways...
Structure your data object/query so that it returns a key and and abbreviation (i.e, first name, last name, id, bio) and use a template that turns id into a link.
Use the onrowbound event to manipulate the controls on the row, so that you have a href to your details page.
Use css to show the additional info on a hover/mouse over (I like this, but it doesn't play well with mobile devices, which don't have either event).
EDIT: Methods 1&3 would be done on your aspx page, method 2 would be done in the codebehind for your page. Method 1 is really dependent upon your being able to control the data object/ query results. If you are calling a stored proc that someone else controls, it may be very difficult to make it work.

Telerik RadGrid Manipulating data from data source before databinding an item

I am working with a Telerik Radgrid on an aspx page, which basically has to bind to a datatable, which gets populated by data returned from a web service. I need to be able to fill out some of the columns in the RADGRID based on the data returned by the web service.
For example, I need to be able to build the Hyperlink column based on the parts data returned by the web service. I need a way to access the datasource before the grid item gets populated and direct execution to a routine which builds the URL for the parts on a website.
Can anybody please suggest an efficient way to do this?
I highly appreciate any help/suggestions.
Thanks
Karthik
(Moving my comment to an answer, because I'm thinking this will work out for you.)
You could always cheat and bind it to the grid, allowing you to access the data, but then hide the columns so the users could never get the data.
Let me know how it works out.
EDIT:
My select statement is "select top 5 ProductName from products"
I then created a hyperlink column and assigned the properties under the data tab as such.
When run, it makes the data clickable and when clicked, it navigates to the url seen in the SS.
That what you need?

Search functionality in asp.net

I'm learning to create a webapp using asp.net and C#. And I already create a basic user database webapp. Wherein I display all the user information in a tabled manner. So basically I just used the table element from HTML and not the gridview control.
But I have a problem right now, I want to add a user search functionality wherein I will just input the user's firstname in the search box, so then when I click the search button it will display the user information in a table format. So I don't know how to implement it because I used the table element not the gridview. Where to I write the data that I searched?
Please advise.
Many thanks
It doesn't matter what you use to display the results, you can reuse that code. The only thing you need to change is the way you select the data from the database based on the firstname.

Problem With Multiple Data Bindings (Silverlight)

I am using silverlight to create an Intranet for managing chemical usage. All data is stored in a MS SQL database, and is retrieved by using a DomainService (RIA).
By dragging the database onto the form, Silverlight has created a DomainDataSource based on this table. By then creating a new record using the following code, I am now able to add new records.
Me.ChemicalApplicationDomainDataSource.DataView.Add(chemicalApplication)
However one of the controls I have on the screen is an AutoCompleteBox. I have bound this to the database, and the values display fine on here. When an item is selected on here, I want to populate the value of a textbox with values retrieved from a second datatable.
I have created an event on the AutoSelectedItemChanged, and added the following code:
Context.Load(Context.GetChemicalByNameQuery(AutoMaterialTradeName.Text))
I can then bind this to a datagrid.ItemsSource, and it shows the relevent record. But I cannot for the life of me get it to bind to a textbox. Textboxes dont have an ItemsSource, only a DataContext, but binding to this does not seem to display anything..
Any tips on how to achieve this?
You would need to bind it to the Text property on the TextBox for that to work. Additionally you would probably need to set the Path property on the binding to get the right property on your object to display.

Resources