Load data in DropdownList by category wise - asp.net

in my ASP.net web application i want load in dropdownlist box by category wise like below screenshot.. How can i do it??
I gonna use two table in DB
One is to Store Available Course
Second Table is Number of Degree like below

you can simplify using optGroup in dropdown...
please follow below link it might be useful for resolve your problem..
Group options for Asp.Net DropDownList
Enjoy coding....

Related

Limiting the number of records in a grid view

Im working on a grid view in asp.net mvc 3 and I need to limit the number of record that will display in my grid(not per page). Is there a way I can do that??. Thanx in advance.
What are you using? Which GridView? It's really tough to help you whithout any detail information. But anyway, I'll try...
IMHO I wouldn't limit the number of records in the view, I would do this on the database query or whereever you get your data!
If you want to set a "JustShowMeXRecords" then put a TextBox or DropDown to your view and give this value to your controller.
If you want to have paging on your grid you can use in example this NuGet Package (http://nuget.org/List/Packages/PagedList). I use it in every project.
It has a static ans dynamic way to get this done.

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?

Dropdown Filtering ASP.Net

I am looking to find the best way to do the following:
Filter data based on the drop down filters, as long as I am within the same product category (e.g. toys, puzzles, etc...), but in different web forms (product grid and product detail). So if I select toys under $25, I need the filter to the toys in a grid format, but if I click to view the detail I need the filter information so I can filter the related items display.
Display certain filters depending on the product category.
Right now I believe that if I build a user control and session variables that I should be able to accomplish this. Do anyone know of any examples of doing something like this or have a better way? Any help is appreciated.
EDIT: Right now I am using the page_load event to update the data and would like to avoid AJAX for right now.
Wade
I think you could use something similar to cascading drop downs with Ajax.
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx
The Ajax toolkit has an example of how to do this in C# and in VB.net:
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/CascadingDropDown/CascadingDropDown.aspx

thoughts on asp.net grid controls

All, I am creating a web application and I need to give users the ability to add/edit/delete records in a grid type control. I can't use 3rd party controls so I am restricted to just whats in the box for asp.net (datagrid or gridview) or creating my own. Any thoughts on the best direction to go in. I'd like to keep the complexity level at a dull roar :)
thanks in advance
daniel
You should definitely use edit and insert templates. All you have to do is give the button/link the command name such as insert/delete/update and you can allow the Grid to do most of all the work.
Check out this link
I think you'll learn to love the gridviews because they are pretty powerful.
Gridviews have different item templates that you can use for editing and inserting data. That'd be an easy way to go about it.
As long as you set your datakeyid property to the primary key in the database, you should be able to make template fields based off of whether or not you're editing or inserting data. The command name of the button you use to fire the event will handle the statements required for updating/inserting data.
This is a good site for some examples.
the out of the box grid is not too bad.
Here are a few links on master detail records in asp.net this should get you started on the CRUD opperations.
http://www.exforsys.com/tutorials/asp.net-2.0/displaying-master-detail-data-on-the-same-page.html http://msdn.microsoft.com/en-us/library/aa581796.aspx
http://www.bing.com/search?q=asp.net+master+detail
this is the best site for what you are after
www.Asp.Net
Data Access Tutorials controls
Master/Detail Using a Selectable
Master GridView with a Details
DetailView
Using TemplateFields in the GridView
Control
Others
Beginners Guide to the GridView
Control
The GridView Control
IN-DEPTH LOOK AT THE GRIDVIEW CONTROL

What control should I use for showing "Featured Products" on my ASP.net Website?

I have various SQL tables and my use case is:
I'll choose 5 Products at random and they'll show in X control (don't know what to use here).
I know I'll have to use SQL and pull the product information using the ProductID as the hook to fish out every other information.
What Control should I use?
---If you want to show random product, then Adrotator is the best choice
---If you are getting product randomly from DB then Repeater or datalist could be the best choice
Depends how you want do display it.
Maybe a Repeater and ObjectDataSource will be useful, depending on your ORM.
Maybe a DataList, maybe a Repeater. explain more about what you want to show.
Two possibilities spring to my half-asleep mind.
the first would be to use a ListView or Repeater and have it themed out appropriately.
The second possibility would be to create a user control that displays the way you want, and then instantiate 5 instances on the web page.
I would make a user control that would take an array of ids as a property. Encapsulated in the user control would be everything you need to do to display your products. This would probably be an array of panels with images and labels.

Resources