Click here to Skip to main content
15,890,717 members
Home / Discussions / C#
   

C#

 
QuestionOptimize the maximum number of threads Pin
devvvy25-Jul-11 22:58
devvvy25-Jul-11 22:58 
AnswerRe: Optimize the maximum number of threads Pin
BobJanova25-Jul-11 23:54
BobJanova25-Jul-11 23:54 
GeneralRe: Optimize the maximum number of threads Pin
Dave Kreskowiak26-Jul-11 1:59
mveDave Kreskowiak26-Jul-11 1:59 
GeneralRe: Optimize the maximum number of threads Pin
BobJanova26-Jul-11 7:33
BobJanova26-Jul-11 7:33 
GeneralRe: Optimize the maximum number of threads Pin
Dave Kreskowiak26-Jul-11 8:58
mveDave Kreskowiak26-Jul-11 8:58 
GeneralRe: Optimize the maximum number of threads Pin
BobJanova26-Jul-11 10:21
BobJanova26-Jul-11 10:21 
GeneralRe: Optimize the maximum number of threads Pin
Dave Kreskowiak26-Jul-11 10:32
mveDave Kreskowiak26-Jul-11 10:32 
QuestionSorting on column, using mvccontrib lib [modified] Pin
omgerik25-Jul-11 22:42
omgerik25-Jul-11 22:42 
Ok, my first time here, don't kill me if I posted in the wrong forum. Anyway.

I have two questions, both regarding sorting a grid in my MVC3 application.

This is what my grid looks like (column names are in swedish):
@(
    Html.Grid<ContactListItem>(Model.Contacts)
        .Sort(Model.GridSortPageOptions)
        .Columns(column =>
        {
            column.For(x => x.Id).Named("Id").SortColumnName("Id");
            column.For(x => x.FirstName).Named("Förnamn").SortColumnName("FirstName");
            column.For(x => x.LastName).Named("Efternamn").SortColumnName("LastName");
            column.Custom(x =>
                {
                    if (x.Company == null) return "Oknuten kontakt"; 
                    else return Html.ActionLink(x.Company.CompanyName, "Show", new { controller = "Company", id = x.Company.Id });
                }).Named("Företag").SortColumnName("CompanyName");
            column.For(x => x.MobilePhone).Named("Mobil").Sortable(false); ;
            column.For(x => x.Telephone).Named("Telefon").Sortable(false); ;
            column.For(x => x.Email).Named("E-post").Sortable(false); ;
            column.For(x => x.IsContactPerson ? "X" : "").Named("Kontaktperson").SortColumnName("IsContactPerson");
            column.For(x => x.IsInvoiceReference ? "X" : "").Named("Fakturareferens").SortColumnName("IsInvoiceReference");
            column.For(x => Html.ActionLink("Ändra", "EditContact", new { controller = "Contact", contactId = x.Id, caller = "contactlist" })).Named("Ändra").Sortable(false);
        })
)


1) As you might figure, "Company" is a sub property of Contact. When I sort on the Company field, it automatically sorts on the ID property of Company. However, I want it to sort based on the name of the company. How can I use SortColumnName for this? Is it even possible? If it is of any importance, I use Fluent NHibernate. A quick solution would be to add an additional property ("CompanyName") to my domain object, but that would be REALLY ugly.

2) When I hit one of the column names in order to sort, a new label appears next to the column name, saying "(asc)" or "(desc)", depending what way it sorts the items. I would like to be able to change this text to either an other language or to an image (like a tiny arrow pointing up/down).

Thank you!

Edit: spelling >_>

/Erik
What does Abraham mean?
modified on Tuesday, July 26, 2011 6:13 AM

AnswerRe: Sorting on column, using mvccontrib lib Pin
omgerik26-Jul-11 2:08
omgerik26-Jul-11 2:08 
QuestionCreat New Security Group At AD Pin
treuveni25-Jul-11 21:33
treuveni25-Jul-11 21:33 
SuggestionRe: Creat New Security Group At AD Pin
Shameel25-Jul-11 23:54
professionalShameel25-Jul-11 23:54 
GeneralRe: Creat New Security Group At AD Pin
treuveni25-Jul-11 23:57
treuveni25-Jul-11 23:57 
GeneralRe: Creat New Security Group At AD Pin
Shameel27-Jul-11 1:52
professionalShameel27-Jul-11 1:52 
AnswerRe: Creat New Security Group At AD Pin
Dave Kreskowiak26-Jul-11 1:53
mveDave Kreskowiak26-Jul-11 1:53 
GeneralRe: Creat New Security Group At AD Pin
treuveni26-Jul-11 4:57
treuveni26-Jul-11 4:57 
QuestionStrange Syntax- public string NewPassword { get; set; }and more Pin
Bram van Kampen25-Jul-11 15:33
Bram van Kampen25-Jul-11 15:33 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more Pin
PIEBALDconsult25-Jul-11 16:06
mvePIEBALDconsult25-Jul-11 16:06 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more Pin
Mark Salsbery25-Jul-11 17:44
Mark Salsbery25-Jul-11 17:44 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more Pin
Matt Meyer26-Jul-11 5:30
Matt Meyer26-Jul-11 5:30 
AnswerRe: Strange Syntax- public string NewPassword { get; set; }and more [modified] Pin
Herboren29-Jul-11 11:10
Herboren29-Jul-11 11:10 
GeneralHello all people, Pin
electrician_man25-Jul-11 6:11
electrician_man25-Jul-11 6:11 
GeneralRe: Hello all people, Pin
David198725-Jul-11 6:14
David198725-Jul-11 6:14 
GeneralRe: Hello all people, Pin
DaveyM6925-Jul-11 8:30
professionalDaveyM6925-Jul-11 8:30 
Questiondata filter options for grid Pin
dessiymartin24-Jul-11 23:51
dessiymartin24-Jul-11 23:51 
AnswerRe: data filter options for grid Pin
Dave Kreskowiak25-Jul-11 1:49
mveDave Kreskowiak25-Jul-11 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.