The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Default sort for data grid control 7.2 WEB
Posted: 18 Jun 08 7:31 PM
|
Trying to get a data grid control that is an account tab to sort by a date field (newest date on top). Properties don't seem to allow me to specify which column should be the default sort, nor does it allow me to choose ascending or descending? What am I missing? This date field is column #4 in the grid. Do I have to use the first column of the grid as the default sort? |
|
|
| |
|
Re: Default sort for data grid control 7.2 WEB
Posted: 19 Jun 08 9:02 AM
|
Ryan,
I have a similar problem. I have a tab form I added to the Opportunity Details page, and I cannot figure out how to make it sort by a specific column on the first display. I set it sothe user can sort after the display, but still need the initial sort to work.
Can you help?
Thanks,
Bruce
|
|
|
| |
| |
|
Re: Default sort for data grid control 7.2 WEB
Posted: 26 Sep 08 12:31 PM
|
Hi Bruce, I did what you said in the post but, seems like its not working for me, i've wrote the following code:
protected void grdPAYMENTs_Sorting(object sender, GridViewSortEventArgs e) { grdPAYMENTs.Sort("PayDate", SortDirection.Descending); }
and of course the allow sorting is set to true, but the grid just seems to be ignoring that statement. the next is the code of the properties of my grid.
AutoGenerateColumns="false" CellPadding="4" CssClass="datagrid" PagerStyle-CssClass="gridPager" AlternatingRowStyle-CssClass="rowdk" RowStyle-CssClass="rowlt" SelectedRowStyle-CssClass="rowSelected" ShowEmptyTable="true" EnableViewState="false" EmptyTableRowText="<%$ resources: grdPAYMENTs.EmptyTableRowText %>" ExpandableRows="True" ResizableColumns="True" AllowSorting="true" OnSorting="grdPAYMENTs_Sorting" >
any help will be really appreciated. Thanks in advance.
-Alan Quinteros |
|
|
|
Re: Default sort for data grid control 7.2 WEB
Posted: 26 Sep 08 12:37 PM
|
Hi Alan,
The problem is where you've put the code. Just add the line below to a LoadAction on the form:
grdPAYMENTs.Sort("PayDate", SortDirection.Descending); |
|
|
| |
|