Ideas for Quick Hierarchical Listing - .NET - asp.net

I have a table in SQL Server listing corporate departments and their sections and subsections (3 levels). I would like to create some web-based listing of this, but similar to a TreeList.
I was thinking to set up nested Ajax Accordions, but it was taking me way too long to put together. I would even settle for a GridView with non-repeating column values.
Is there a way I can implement my idea without it taking me more than an hour or so for a newbie to complete? Any controls in ASP.NET or Ajax I can bind to would be great.

Thanks to Ozzy, I was able to solve this simple issue using a TreeList. Since my issue is simlper than the one in the tutorial he supplied, all I did was create DataTable for each level, and for each row I added the TreeNode (which was simply the string value of that entry). Thanks!!

Related

SSRS/RDLC Detail Data Single Value repeated

I have been plagued with an issue for SSRS (really RDLC report viewer report) in that the details rendered in a report are the same value all the way down in a group. I faced this before and ended up having to create a new view and pull it into the solution and rebuild the report from scratch. As I am having this again I really want to know what else to try. I have deleted the tableadpator and added it back again, tried cleaning and rebuilding solution. I had altered a view, added a couple of columns to the end, so that is my suspect item as another report that uses the same base view now has a similar problem. This is not a code specific example and sure hoping someone else has seen this behavior and know how to get rid of it.
So I have a ASP.Net web application that uses the report viewer to render some reports, RDLC. I use entity framework for my data access and bind the data to the report.
I found what seems to have been the problem. I am using Entity Framework (EF) and I updated some views to add additional columns for reporting. EF randomly picks a key for columns. If I manually set the key to what it should be, and I set my grouping to be on an ID column rather than text (not sure this really fixed it, but adding as it is part of my solution), then the report is now not duplicating the same data for each row. The odd thing was the count of rows for the group was correct, just somehow would only render the first row data for each row. I know this is not a great example of the root problem and fix, but at least all the reports I had issues with are now working and the only thing that changed for some was the EF model was updated for the view that would bind to the RDLC report.

Using more than one table with linq datasource on custom control

I'm probably opening myself up to a world of trouble with this one but here goes. As part of a project I have to have a method of representing a timetable for university students, showing lectures, times, rooms etc. I'm not a coding pro so I have found (and ok'd with uni) an opensource control by the name of DayPilot lite www.daypilot.org. I have that installed now and am beginning the arduous task of figuring out what to do with it. I know I need to bind it to a datasource. My problem is that to give all the information I have mentioned, I need to pull data from 3 tables. When I go to set up a LinqDataSource on the aspx page I can only pick tables from one. I have been searching for ages trying to locate some info. This is the best I have came across: http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx.
However it does not make sense to me. I can't see where he actually connects more than one table to the datasource on the aspx page, in asp code. Am I missing something glaringly obvious here. Is it perhaps a case that I connect it to one table through the linq DS and then write queries to pull the rest of the data I need. In that case how would the data be shown in the calendar if I only connect to one table. Here is the asp code for the calendar anyway.
`<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="OrionDataClassesDataContext" EntityTypeName=""
Select="new (Module, Building_code, Event_type)" TableName="Events">
</asp:LinqDataSource>
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" />`
Obviously that is very preliminary. Plenty of work to do. If someone could give some (simple) advice it would be great. Thanks....and before anyone says it, I know I need to get rid of the default names haha.
Well, I have never used LinqDataSource, or anything on the direction of what you are doing right now. I'm still using the all sql-statement-in-code-behind method. So my idea below might not work.
If I understand correctly your question above, define a view to return result of your join tables, and add the view to your DataContext. In the LinqDataSource control, set the Tablename property to the view.

ASP.Net Datagridview paging without using SQL Server

I'm working on one project where data is coming from the WCF web services and in the List format.
Firstly, Is it possible to assign that list directly to the data grid view? If not then I'm converting that list into Dataset and binding to the Grid but the problem is, Collection List contains thousand of records and converting into Dataset decrease the performance.
Also, This is a direct bing with List or the Dataset to Gridview so is it possible to achieve the paging including First, Previous, Next, Last and Page sets?
Your help would be appreciated.
Thank you in advance for the help!
Dhaval
I dont think you can 'directly' do it but somehow , theres a way. Here is a question of the same matter.
Gridview using a generic list as DataSource and Auto-generating columns

Variable number of categories/checkboxes

I am building a form for parents to enter health information for their students. Our nurses want to build it similar to what you fill out when you see a new doctor where they have categories and then conditions within the category that you would check if they apply to you. They want the number of categories and conditions to be variable so they can change them willy nilly as desired.
I need some ideas as to how to approach the UI side. My initial thought is a parent gridview with a row for each category and then inside that, a child gridview for each condition with its own checkbox. I already do a bit of work with gridviews and know how to access the nested objects so I'm not terribly worried about how to get the data back.
My question is this: Is there a better way and what suggestions would the community make that might be different or more efficient than using nested gridviews?
+1 for asking is there a better way?
What I'm about to suggest may end up being a little more complicated at first, but rest assured it will be worth it in the end.
There is a JavaScript framework named Knockout.js that is perfect for situations like these. Knockout vastly simplifies situations that where a variable amount of UI controls are needed.
http://knockoutjs.com/
Here is a tutorial on the website that has a similar situation to yours:
http://learn.knockoutjs.com/#/?tutorial=collections

Easy way to replace Data with ComboBox? Or populate ComboBox from Data

I took over a very old project written in VB6, it's a mess and I don't really know VB so it would be great if someone could help me.
I have a Data control which gets records from an Access database which I would like to replace with some kind of drop down list - I thought about ComboBox. Unfortunately I cannot get records from the database in the same way as with Data, so I thought about populating ComboBox based on what's in the Data control. How can I achieve it? Or is there a better way to do it?
My last resort is to create all database methods manually in order to replicate Data's behaviour for ComboBox but I think it's too much effort for such a small change.
Thanks in advance!
The Data control does more than just let them browse through the records, it manages the database, current record, data binding, etc.
The easiest way to do what you want is to hide/move the data control and use its .Recordset.Find*() methods.
Note that DAO is archaic and has been supersceded at least once for VB6 (with ADO)

Resources