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
Related
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....
Please excuse me for a probably low quality of this question, since I'm not a web dev, so I possibly don't now some obvious things and don't know what to Google for. I think problem must have some simple solution, but I'm struggling with it for two days now, so I feel myself pretty stupid :-).
I have a custom control which is a set of checkboxes which are added dynamically based on a property which is set in OnLoad event of a page. I have two such controls on a page and second control items should be based on items selected in first control.
The problem is, I can't figure out, how to catch on autopostback which boxes were selected in first control before second contol is constructed to pass this data to it?
Take a look at this.
http://forums.asp.net/t/1440174.aspx
Since your building them dynamically, they are not as easy to find as webforms would like to be, if you added them to the page and wired up events and such.
Your going to look at the Request.Forms list, and search thru it for any controls you want.
I believe checkboxes are like radio buttons, they only return if they are checked, which is good, cause you want to know which ones were checked.
I've used same solution as in the accepted answer for this question: Dynamically Change User Control in ASP.Net , just need to assign an unique id for each dynamically created CheckBox in custom control. Not as clean solution as I want but at least it works.
You can save the data in the ViewState, QueryString or as Session before moving to the next page and you can do modifications based on it.
I'm attempting to build a page that displays the same set of information of different "items" in a grid or table. It's akin to a shopping page that displays products in for e.g. a 4 by 3 table.
I came across datagrid and gridview but they display grouped information according to columns and each row representing one item only.
Is there a control that displays data in a very basic grid format instead of tabular form, preferably with built in pagination abilities?
Many thanks in advance
You will want to use a DataList or a Repeater, as those controls allow you to specify the exact HTML you want for each item. Unfortunately, neither of those have built in pagination, but honestly, the built in pagination in the GridView is of questionable usefulness, since it only works if you use a specific data source or load everything from the database up front.
I'm not sure what you mean, you want a basic grid, but gridview doesn't work for you. But in any case, check out the repeater. It will require a bit more work to built a template for your items, but it's very flexible and can handle what you want.
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.
In VisualStudio, when you drag and drop a table or an individual column from a data connection in server explorer, a gridview is created.
What I want to be able to do is drag and drop the columns to make a quick and dirty detail form to display an individual record. Is this possible in any way?
An even better way to do this would be via a custom T4 or LLBLGen template but I have no clue how to do this.
Any other suggested approaches?
UPDATE: A DetailsView is the type of thing I am looking for, in that you can select a data source and the specific columns you want, but I'd like to be able to have manual control of the layout and formatting after the initial drag and drop.
I suggest binding a DetailsView to the table using a data source (SqlDataSource) instead. You might find these tutorials, especially this one helpful.
In response to your update, have a look at the FormView control. It gives you complete control of the layout using templated sections.
There appears to be literally no way to do this in VS that I have come across.