.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Sort Display Columns

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net


I want to be able to sort the display columns in the insert/edit screen in Dynamic Data.  I'm using VS 2010.

I have a the following structure:

Table:  Mentor


Column:  PersonId references Person Table(LastName, FirstName, MiddleName)

Column: AddressId references Address Table(Street, City, State, ZipCode)


I'm trying to insert a mentor and the mentor screen shows up with Address first then Person.  How can I code it with Person data showing first?

Here's the Mentor.cs:

    public partial class Mentor
        partial void OnValidate(ChangeAction changeAction)



    public partial class MentorMetaData
        [Display(Order = 0, GroupName = "Personal Information")]
        [UIHint("Person", null, "persontype", "P")]

View Complete Post

More Related Resource Links

Can two columns have the same display names but different underlying names?


I have two columns which are set up differently. But for a display purpose and different usage, they should share the same display names but not the underlying name. How may I set them up in SharPoint?

Autocomplete display multiple columns


 Hi --

I have an autocomplete extender working great returning one column and I can also retrieve multiple columns just fine from my stored procedure, but here's what I really need to do:

1. Format the data in the autocomplete extender in the following format:

Location Number
City, State, Zip

2. When the user makes a selection I want only the Location Number to populate the textbox.

I've looked quite a bit on this site and others on how to do #2 and I can't seem to find exactly how this should be done. Is there some javascript that needs to be involved in order accomplish this?

If anyone has done this I would really appreciate an example.




SSRS2008 Sort columns by row Subtotals

Hi! Have problem with sort some data report. Use Tablix in report, where have Total, Month, Subtotal, Week, Day as ROWS and City as COLUMN. In data cell there is SaleAmount. So in Subtotal and Total there is SUM(SaleAmount) for every City - properly view because of grouping. I'm wondering how to make parameter for sorting data in this report, where have to choose 1.Sort WeekSale 2.Sort MonthSale greets Tomek

Display records in multiple columns in asp.net mvc

 Hello,i'm newbie to asp.net mvc. i use mvc 1.0 since my host supports that.i have a piece of code in my view like this and i want to change it in order to be able to show records in 4 columns.What should i do?<table>            <% foreach (var item in Model) { %>                     <tr>                                  <td>    <%=Html.ActionLink(item.CategoryName + "(" + item.NumberOfWebsitesInCategory + ")", "SubCategory", new { CatID = item.CategoryID }, new {style="text-decoration:none;" })%>                         </td>                    </tr>        <% } %>    </table>

WPF: how can ListBox display three columns: first and thrid column width base on the longest content


We try to use ListBox to display three columns: so the first and last column width will depend on the longest content in that column to decide and second column take the rest of space as its width.

How can we use ListBox to achive that?

should we try with the ListView? thx!

Sort WPF Datagrid using multiple columns



Is it possible to sort a WPF datagrid using more than one column ?



want to know how to display columns from a table

i want to know how can i get the columns from a table

Display columns in matrix based on a group even if data don't exist in resultset


I am trying to create columns in a matrix for data that currently does not exist.  I created a matrix that groups on office name (ROWS) and Month of Appointment Date (Columns).

For example, the matrix currently looks like this.....

  January February March April

Hide / display page layout columns for different users


I'm looking for a way to hide some columns of a page layout so they will be shown only to specific audience (for example hide the "created by" column so some users won't see it). Any suggestions?


display / insert values by comparing 2 columns of a table



i have a table which has the following columns 

A_ID, A_Value,A_Date,B_ID,B_Value_B_Date


i have another table as follows

A_ID,B_ID,A_Value,B_Value, Date


this is to be done 

* if A_date and B date are equal, one record shoould be entered to the TABLE 02. the values should be A_ID,B_ID,A_Value_B_Value and A_Date (since the date is equal, no problem; even can insert B_Date instead of A_Date)

* if A_Date and B_Date are different, then the following should happen

insert one record to TABLE02 as A_ID,B_ID, A_Value, 0 , A_Date

insert another record to TABLE02 as A_ID,B_ID, 0 , B_Value, B_Date


(As you can see, when the date differs we enter the single record of Table 01 into 2 recoerds in table 02. the Value column and Date column are related in such a way that when A's date is entered, the value for B should be 0 and vise versa..)


i tried having a UDF but in halfway remembered that we cannot include INSERTS in UDFs..

can anyone please explain me how can i solve this problem ??


PS: For your reference , i've sketched a diagram. please click on this link to view it for further clarifications



thanks in advance

-novicedba :)

How to sort the lookup columns in edit mode?




I have a custom list "A" which has a lookup field from another custom list "B".

In the edit mode of "A", the items' order in the little pickup window is by alphabetically ascending order of that field from
"B". No matter how I change the default view's order in "B", I cannot let the field to be ordered by ID in "A"'s edit mode.


Is there any way to do that?




How can I use ORDER BY by passing different columns and sort orders?


Hi all

Here is what I am trying to do:

declare @dateBegin as datetime, @dateEnd as datetime
declare @column as varchar(30), @order as varchar(4)
set @dateBegin = null
set @dateEnd  = null
set @column  = 'created'
set @order   = 'DESC'

	(@dateBegin is null or startTime >= @dateBegin) and (@dateEnd is null or endTime <= @dateEnd)

Matrix Report With Month/Year Columns - Display date even when there are no records for that month


I've created a matrix report that displays the quantity of different products  set to expire by month/year. The stored procedure returns records for a variety of products and each record contains an expiration date. If there are no products/records that contain an expiration date of lets say 6/2010 then 6/2010 will not appear as a column in the report.

I need a way to force these month/year columns to appear in the report.


Does anyone have a suggestion on how I can make that happen?


Rick Dowdall


How Do I Display Sum Of Repeater Columns In Footer



I'm trying to calculate the sum of prices that are displayed in my ASP.NET Repeater.

I'm coding with C#.

Any ideas?

My code'

<asp:Repeater ID="Repeater3" runat="server" DataSourceID="ListaFaktura" 
                <table cellpadding="0" cellspacing="0" border="0" >
							<th>Datum betalt</th>
							<th class="price">Pris</th>
							<td class="price"><%# String.Format("{0:c0}

Display multiple Columns in Single Column in SQL CE 3.5


I have table with different columns

Ex. Device table

Columns : deviceid,devicetype,device1,device2,device3,device4

                    1  Swich board         D1      D2        D3       D4

                    2  Sensors              S1      S2         S3       S4

i want to display this  table contains in single row

Device Name








Please Help me


Thanks in advance



MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend