C# - Order The Subcategories Alphabetically?
Mar 24, 2010
I have a table:Category with some sort of categorie
[code]...
Well, the strange question is: how can i order the subcategories alphabetically?
If i'd have binded the children repeater to a linq it would be easy.
But in this case?
View 1 Replies
Similar Messages:
Feb 6, 2011
I have a class
public class CountryListViewModel
{
public IEnumerable
Countries { get; set; }
}
public class CountryViewModel
{
public string CountryName { get; set; }
public string State { get; set; }
public IEnumerable<CityViewModel> Cities {
get; set; }
}
public class CityViewModel
{
public string CityName { get; set; }
public string CityLink { get; set; }
}
using linq to entity grouping by country and it works as designed. but I also have to group by state.
var query = from c in _db.MyTable
where c.IsActive && c.Country == country
group c by c.Country
into loc
select new CountryViewModel()
{
CountryName = loc.Key,
Cities = loc.Select(s => new CityViewModel() { CityName = s.City, CityLink = s.City }).Distinct()
};
View 2 Replies
Dec 8, 2010
i have one requirement like i want to show all the categories with the subcategories ..
i mean if i have the Sale category it will be heading of the gridview and all sub categories of the Sale category foreign key related subcategories display in that gridview like urls .same way it will show all the categories ..
View 7 Replies
Apr 18, 2010
I have a page for a client that currently is setup to display a gridview for each subcategory. They recently added a new subcategory and they were wondering why it wasnt showing up on the page. Well the way i have it setup, i have to create the gridview adn datasource for the new subcategory.
Is there a way to setup the page to display a gridview view for each subcategory so if they decide to add another, i dont have to update the page with a new gridview adn configure it? I would like to be able to update what i have and provide a more flexible setup for them.
keeping i mind that each gridview would contain different result sets, is this possible? if so, what controls would i use?
View 3 Replies
Nov 30, 2010
This should be a fairly simple one. I am creating a dataset which will contain a description field which I would like to sort by. The reason I want to sort the dataadapter and not in my SQL is that I am already ordering by the results that have a particular value. My SQL looks like this:
SELECT pif_desc, pif_fund, psf_end, (CASE WHEN SUM(pmi_units) IS Null THEN 0 ELSE SUM(pmi_units) END) As fundunits FROM tbl_mem INNER JOIN tbl_sfunds ON pm_scheme = psf_scheme INNER JOIN tbl_invfun ON tbl_fund = tbl_fund LEFT JOIN pe_minv ON pmi_fund = pif_fund AND pm_member = pmi_member WHERE pm_member = @pm_member GROUP BY pif_desc, pif_fund, psf_end ORDER BY fundunits DESC
My VB looks like this:
Dim cmd As New SqlCommand("getMembersFundsDCGENST", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim p_pm_member As New SqlParameter("@pm_member", SqlDbType.Int)
p_pm_member.Value = pm_member
cmd.Parameters.Add(p_pm_member)
Dim p_period_closing_date As New SqlParameter("@closingdate", SqlDbType.DateTime)
p_period_closing_date.Value = period_closing_date
cmd.Parameters.Add(p_closing_date)
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds)
I want to sort the datarows is ds.tables(0) by pif_desc but still have the rows with fundunits > 0 listed first.
View 2 Replies
Feb 4, 2011
my code will explain what the problem is in the WHAT DO I PUT HERE section how can get the list ordered by a-z?
View 3 Replies
May 7, 2010
I am dynamically binding the treeview using DOM.
I m populating the tree by sayin treeview1.nodes.add(Treenode)
After this, i need to sort them alphabetically. I have followed this ref:[URL] but I was not able to understand how to do it only for parent nodes, since I don't have child nodes.
Moreover I m not able to get property sort().
How do I achieve this?
View 1 Replies
Feb 20, 2010
We have a list of titles, some of which start with numbers (e.g. 5 Ways to Make Widgets). We would like to sort this as if it were "Five Ways..." without changing the title. We know that some movie places do this, but I can't find info online on how to do it.
View 4 Replies
Jan 23, 2010
I have 5 hard corded texboxes in a page in a sequence with sequence Number . Now i want to add re-order /re-arraning functionaly .. but i can't use ajax reorder list because i have 5 hard corded texbox. how can i maintain the order in Insert/Update cases. And also suggest me control that i can use, another than ajax re-order list. coz i not using any list items i have hard corded items on the page.
View 1 Replies
Feb 7, 2011
The AjaxToolkit has a ReorderList. I'm searching for a jQuery solution that does the same and found this page. I would like to change the order of divs (vertically) and upload the new order to the database (ajax).
View 2 Replies
Oct 22, 2010
I have two table Order and Order Detail.
What i need is i need to bind last 10 Order in Gridview/details view with paging, and the same order detail also fetch from database and shown in another gridview.. if user click any oderNo in first Gridview/DetailView then i need to show Respective order detail in anther gridview..
without postback coz we already fetch 10 order with orderdetails from the database..and if user click next 10 orderNo using paging then again we need to load 10 orderNo with respective orderdeatils from database like this going on....as well as let me know how to take print of particular oder and order detail....?
View 7 Replies
Feb 8, 2010
I'm wondering if Visual Studio is ever going to allow users to sort the available templates alphabetically.
When clicking on File | New File, I'm greeting with the New File dialog window, which has a seemingly arbitrarily ordered list of items to choose from. This isn't so bad, because there aren't that many, but it would still be nice to order them.
When right-clicking a project, and choosing Add | New Item, I get a Add New Item dialog box that has the same dementedly senseless order, and there are many more of them. Fifty-three on my system, in fact. Having no easy way to order these alphabetically is a serious pain, and I've seen complaints about it all over the Internet. Does anyone know of a way to get Visual Studio 2008 to order these templates alphabetically, and does anyone know if Visual Studio 2010 will finally include this feature?
I found a PowerShell script online that was supposed to accomplish this, but it appears to have been written for .NET 2.0, and I'm using .NET 3.5. I don't have the time to pick apart the PowerShell script and hope I get the modifications right.
View 2 Replies
Feb 1, 2011
How to sort the names in combobox alphabetically?
View 3 Replies
Jun 15, 2010
i have a gridview populated by a Web Service search function. some of the columns in the grid are templatefields, because the values coming back from the search (in a datatable) are ids - i then use these ids to lookup the values when the rowdatabound event is triggered and populate a label or some such.
this means that my sorting function for these id/lookup columns sorts by the ids rather than the textual value that i have looked up and actually populated the grid with (although i do put the ids in the grids datakeys).
what i want to do is top be able to sort by the looked up textual value rather than the codes for these particular columns.what i was going to do to get around this was to when the datatable comes back from the search, adding more columns the textual values and doing all the looking up then, thus being able to sort directly from the manually added columns.
is there another way to do this? as that approach seems like a bit of a bodge. although i guess it does remove having to do the looking up in the rowdatabound event....
my sorting function works by sticking the datatable in the session and on each bind grabbing the sort column and binding the gridview to a DataView with the sort attribute set to the column - and the direction.
View 1 Replies
Apr 24, 2010
From my testing, it appears that the order of parameters for the UpdateParameters must match both the order of the bound fields on the form (asp:Formview), and the order of the parameters in the UpdateCommand. Is that correct? If so, why do the parameters have names if all that matters is the order? I tried both asp:ControlParameter and asp:Parameter. Maybe the more relevant question is why aren't the names used instead of the order, particularly for the form order?
So, given I display the Identity field (CID), and need that for the update, I cannot get the update to work without including it in the UpdateCommand. Of course, since it is an autonumber field in Access, I cannot actually set it. So, I had to add another field to the db (lngUpdateCID) that I could set. That can't be how it has to be done, but I could not figure out another way to do this.
The relevant code is below:
[Code]....
View 23 Replies
Jan 24, 2011
I need to sort dropdownlist alphabetically.
This is the code I am using ,its working but it brings numbers first and then alphabets like 1,2,abc,bcc..
[code]....
View 4 Replies
Jan 19, 2010
I am having a problem .I want to display the book category and subcategories which is fetched from database .
I want to show record like
Example
--------
A
Autobiographies
- Advertising
- Artists
[Code]....
How to show record like this and which control I have to use for this.
View 2 Replies
Apr 28, 2014
LinkButton A
LinkButton B
A B C D E
-----------------------------------------
EmpID EmpName
1 Aakash
2 Ajit
View 1 Replies
Feb 12, 2010
I want to do something like this.
[URL]
i have all the categories in my dataset. now i want my repeater to display it in alphabatically categories.
View 2 Replies
Aug 31, 2010
This seems very basic but I can't seem to find a fast way to do it..
I have the following numbers:
5, 3, 10, 52, 1
I want to order them in the correct format from 1 to 52 and be able to point out which one is the highest, which one is the lowest, which one the second to highest, etc.
View 7 Replies
Jan 11, 2011
I have a form with some textbox and buttons. Now by default, tab order is going as per the sequence of controls on my page. But I want it to in some different manner. Also Tabindex property does not behave in desired manner
Note: There are 4 tables within main table. the order which should go is: First in table 1, then table 3, then table 2, then table 4 The manner I want is:
txtExamName
txtExamDescription
btnExamAdd
btnExamClear
btnEditExam
btnDeleteExam
txtProgramName
txtProgramDescription
btnAddProgram
btnProgramClear
btnEditProgram
btnDeleteProgram
Here is my code:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
Inherits="System.Web.Mvc.ViewPage<ReachOps.ApplicationServices.ExamDTO>" Title="Exam Type Program Type" %>
<%@ Import Namespace="ReachOps.ApplicationServices.ViewModels" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<link href="<%= ResolveUrl("~") %>scripts/Grid/mvcGrid_blue.css" rel="stylesheet"
type="text/css" />
<link href="../../scripts/DialogControl/subModal.css" rel="stylesheet" type="text/css" />
<link href="<%= ResolveUrl("~") %>scripts/Grid/mvcGrid_grey.css" rel="stylesheet"
type="text/css" />
<link href="<%= ResolveUrl("~") %>Content/ReachStyle.css" rel="stylesheet" type="text/css" />
<link href="<%= ResolveUrl("~") %>scripts/ContextMenu/skins/cm_default/style.css"
rel="stylesheet" type="text/css" />
<link href="../../scripts/DialogControl/subModal.css" rel="stylesheet" type="text/css" />
<link href="../../scripts/ETPT/AddEtpt.css" rel="stylesheet" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<script src="../../scripts/DialogControl/subModal.js" type="text/javascript"></script>
<link href="../../Scripts/DialogControl/subModal.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../../scripts/ETPT/ETPT.js" type="text/javascript"></script>
<script src="../../scripts/jquery.getUrlParam.js" type="text/javascript"></script>
<script src="../../scripts/Grid/grid.js" type="text/javascript"></script>
<script src="../../scripts/Utilities.js" type="text/javascript"></script>
<%--Hitesh Gupta
Mantis ID :-12908, Date:-06/01/2011--%>
<script src="../../Scripts/jquery.alerts.js" type="text/javascript"></script>
<link href="../../Scripts/jquery.alerts.css" rel="stylesheet" type="text/css" />
<%--Mantis ID :12908 Ends--%>
<div id="MainPage" class="MainDiv">
<table class="MainTable">
<tr>
<td colspan="6" class="BlankRow">
</td>
</tr>
<tr>
<td class=" Active " onclick="javascript:window.location.href('AddETPT');">
<a class="TAb_a " href="/ExamTypeProgramType/AddETPT">Add Exam/Program Type</a>
</td>
<td style="width:5px;"></td>
<td class="Inactive " onclick="javascript:window.location.href('ETPTAssociation');">
<a class="TAb_a " href="/ExamTypeProgramType/ETPTAssociation">Exam/Program Type Association</a>
</td>
<td style="width:5px;"></td>
<td class="Inactive " onclick="javascript:window.location.href('ProductList');">
<a class="TAb_a " href="/ExamTypeProgramType/ProductList">Product List <span id="spnProductCount">
</span></a>
</td>
<td class="Blank">
</td>
</tr>
<tr>
<td colspan="6" style="width: 935px; background-color: White;">
<table class="outerTable">
<tr>
<td colspan="5" style="height: 10px;">
</td>
</tr>
<tr>
<td style="width: 20px;">
</td>
<td class="TopTitle" colspan="3">
<img src="../../Scripts/UCD Design/Icon_Information.gif" alt="" style="vertical-align:bottom;" />
<span style="vertical-align:middle;">
Add or edit exam types (ET) or program types (PT) in the page below:</span>
</td>
<td style="width: 20px;">
</td>
</tr>
<tr>
<td style="width: 20px;">
</td>
<td>
<table class="LeftTable">
<tr>
<td colspan="2">
<div class="TitleDiv">
Add Exam Type
</div>
</td>
</tr>
<tr>
<td style="width: 100px; height: 15px;">
</td>
<td style="width: 315px; height: 15px;">
</td>
</tr>
<tr>
<td style="color: #990000; width: 100px;">
*<span style="color: #434343; font-weight: bold;"> Exam Type </span>
</td>
<td class="RightTd">
<input id="txtExamType" type="text" />
</td>
</tr>
<tr>
<td style="width: 100px; height: 15px;">
</td>
<td style="width: 315px; height: 15px;">
</td>
</tr>
<tr>
<td style="color: #990000; width: 100px; vertical-align: top;">
*<span style="color: #434343; font-weight: bold;"> Description</span>
</td>
<td class="RightTd">
<textarea id="txtExamDescription" rows="3" cols="30" >
View 1 Replies
Nov 2, 2010
I have a GridView that's displaying a bunch of name/value combinations. The name column is a hyperlink to a details page. The value column is editable - it displays its text in a <asp:TextBox>. I'd like to set up the tab order so that the user can press tab once to go to the next value textbox. Currently, pressing tab takes the focus to the hyperlink on the next row rather than value box. I'd like the hyperlink to be "skipped" and focus to jump directly to the second column (the value column) in the next row.
View 1 Replies
Jun 1, 2010
I have set the Tab order of all the controls on the form but when I run the application.the tab order is out of sync.I have used a groupp panel in which the tab works ok but not working in syc out of that. what precautions should I take. Having the same problem in VB.net applicaiton form.
View 3 Replies
Aug 5, 2010
i am working with a database to create a website i know how to display the data into tables on my website but is there a way of changing the database layout when a button is pressed. i.e. so that when a button is pressed on the website the program sorts all of the first names into order (A to Z) in the database - so that the information is displayed A to Z
View 4 Replies
Aug 11, 2010
PropertiesMustMatch fails because for some reason it's hit PRIOR to "Required" property. How come??
how do you set the order or validation so that Required is hit prior to any custom validation?
I have a class like so:
[Validation.PropertiesMustMatch("Password", "ConfirmPassword", ErrorMessage = "'Password' and 'Confirm password' do not match.")]
[Validation.ValidateMemberUsername("Username", "Oldusername")]
public class Member
[code]....
View 1 Replies