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?
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() };
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 ..
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?
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.
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.
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.
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.
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).
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....?
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.
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.
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.
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.
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:
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.
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.
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
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]....