DataGrid - Is Possible To Disable Sorting On Specific Columns

Sep 30, 2010

is it possible to disable sorting on specific columns? 5 out of 7 columns have to be sortable, two not sortable. The columns are created dynamically in code behind, so I think doing this with mark up is out of the question. When I say disabled, I'm hoping that the underline wont show on the column header when you mouse over it.

View 1 Replies


Similar Messages:

Forms Data Controls :: Datagrid Template Columns Sorting

Mar 4, 2011

can i implement multiple column sorting in an ASP.NET DataGrid.Datagrid contains Template columns.

View 5 Replies

Forms Data Controls :: Datagrid Column Sorting With Two Columns ( File Name, And Date Created )?

Jan 3, 2011

I have a datagrid with two columns ( File Name, and Date Created ). I want them to be sorted when clicked (ASC or DESC). I went into the design view and added the allow sorting feature and added the column names, so they are clickable in the header of the data grid. I also already added the onsortcommand as well.

My datagrid is named dgFileList and the onsortcommand method is named dgFileList_SortCommand.

The procedure that is already loading on page load is a DataSet. (where I think my problem is)I dont have anything in the back end beside the dgFileList_Sortcommand method. From what I have read, it seems like I can't use a DataSet to be sorted...I'm using visual studios 2005, C#, not VB.

View 5 Replies

Forms Data Controls :: Datagrid - Displaying Specific Columns As A Dropdown

Mar 16, 2011

I have a datagrid which displays a list of user data, such as name, his or her status, age. I have created a list of rows of user data but where the column shows status for example Single, Married, i want it to create a dropdown list where i can easily change the user status by selecting it from a dropdown and clicking the update button at the top of the datagrid. The update button will update all records that have been changed not just from the dropdown. I assume the dropdownlist requires a columnbinding event but i can't find any straight forward tutorials.

View 2 Replies

Data Controls :: GridView BoundField Column Readonly - Disable Specific Columns In Edit Mode Of GridView

May 7, 2015

How to disable editing the data in the cells of datagridview in c#?

View 1 Replies

C# - Sorting A Template Column In A Datagrid?

Aug 5, 2010

I have a datagrid and a template column which is bound. I don't understand how to set the sortExpression to make sorting on that column work.

View 2 Replies

Default Column Sorting From Datagrid

Oct 7, 2010

I have 5 bound columns to be retrieved from the database but I want that on page load event the retrieval of data should be sorted according to that column only

View 1 Replies

C# - Sorting Specific Column In A GridView After A DataBound?

Feb 9, 2010

I have given an access to stored procedure, which i'm not able to edit. This Stored Procedure returns a Table with 2 Column, what I did is set a GridView's DataSource using SQLDataSource in this stored procedure. but I want this GridView to Sort an specific column to descending whenever this GridView Loads.

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource2" ForeColor="Black"
Width="58%" Height="125px" AllowPaging="True" AllowSorting="True"
PageSize="5" >
<Columns>
<asp:BoundField DataField="DateOccur" HeaderText="Login Date"
SortExpression="DateOccur" />
<asp:BoundField DataField="TotalMinutesPlayed" HeaderText="Total Minutes"
SortExpression="TotalMinutesPlayed" />
</Columns>
<AlternatingRowStyle BackColor="#EFEFEF" />
</asp:GridView>

View 2 Replies

Sorting - Updating DataGrid To A GridView Control

Dec 1, 2010

I have a datagrid that is displaying data that is being returned from a stored procedure. That works fine. The problem is that I want to do sorting. I know that there is sorting functionality in the grid, however, I don't want to go back to the server and get a new set of data. What I want to do is just re-sort the data that is already being displayed.

Basically, I couldn't not find an easy solution to this issue. I tried updating my dataGrid to a gridView control and even that (for my particular issue) was difficult. I wound up un-doing all the changes and just adding another grid that had just the data I wanted for the requirement. If anyone else has an issue like this I would recommend taking it out of a datagrid and writing it in jQuery. I could of written a table that had the data I wanted (and fully sortable using a plug-in mentioned below) in 15 minutes compared to the hours I spent trying to jam a square peg into a round hole.

View 2 Replies

How To Work Datagrid Sorting And View State

Dec 21, 2010

how does it work when i have a data grid that i want page able and sortable, do i use view state? does the data get pulled once and then the view state keeps all the data and grid working, sortable, page able? or do i need to go to the db server each time i page and sort?

View 2 Replies

ADO.NET :: Paging And Sorting Using Different Columns?

Sep 26, 2010

SQL database, Linq to SQL class a ASP.NET page with a LinqDataSource and a gridview.

The table has a ID field, a date field and a Serialnr field.

In my Grid I like to Page on the datefield but to sort on the serialnr field (or a selectable other field.)

Is that possible? Standard the paging is always done on the sort field and when you select a different sort field the page jumps back to the first page, and paging is then done over the sorted column.

View 1 Replies

Forms Data Controls :: Sorting Of DataGrid Without DataSource?

Jun 9, 2010

I have a datagrid with some data in three datacolumns. I have to apply sorting to two of the datacolumns. Is it possible without any datasource..

View 2 Replies

Sorting Headers For Data Columns

Apr 12, 2010

For the data obtained from data set, how to design Sorting headers for Data Columns in grid view in asp.net?

View 1 Replies

Forms Data Controls :: Run Javascript Before Sorting Or Paging The Datagrid?

Oct 19, 2010

what I am trying to do;I want it so that when the user clicks on the datagrid column headers to sort the records, or when they go to page the datagrid, that a confirmation pop-up appears first, confirming that their changes are going to be lost (unless they click "Cancel").I have the confirmation pop-up scripted in Javascript and is added to the controls on the page using

[Code]....

How do I attach this to a datagrid header and to the pager?Do the columns need to be Template columns and the header text being hyperlink? If so, how do I set it up so it will, if the user clicks "OK" in the confirmation pop-up, still sort?

View 3 Replies

Forms Data Controls :: Sorting A Datagrid Loses Its Formatting

Jul 15, 2010

I have my data grid and sort on a column but the row formatting stops working. I simply selected a format using the autoformat option and picked classic. Am I meant to reapply the row formatting after the sort? And if so how?

View 1 Replies

Forms Data Controls :: Sorting By Calculated Templatefield In Datagrid?

Sep 28, 2010

I have tried several different approaches .SOMEONE PLEASE sow me how to sort on template field with a calculated value.Basically i have half the data i need in the DB and the other half comes from textbox1.textI take the text in textbox1 and pass it along with a value from the DB (Orig) to a function that returns miles.

[Code]....

Whit the above method everything displays correctly but i cannot sort on that column .I also tried using the miles() function in my select statement for my datasource but that was a nightmare and couldn't get that to work i either got "undeclared function "miles()" or when i fixed that i got "orig" not declared.Sorry code is so jumbled , entire code is below:

[Code]....

View 15 Replies

Forms Data Controls :: Datagrid With Column Choose To Choose Columns Dynamically Using DataGrid With Object Data Sour

Sep 30, 2010

I have "Order" object with Columns Ticket,OTP and CustomerName etc.Intially on DataGrid, I'm binding Ticket only , when user clicks on "Column Chooser" button, another windows appears to pickup CustomerName,OTP columns to add specified column dynamically on Datagrid. Environment : Asp.net ,C# with Object Data source

Public Class Order
{
publc void Order()
{
}
public string Ticket
{
get
{
return this.strTicket;
}
set
{
this.strTicket = value;
}
}
public string OtpNumber
{
get
{
return this.strOtpNumber;
}
set
{
this.strOtpNumber = value;
}
}
public string CustomerName
{
get
{
return this.strCustomer;
}
set
{
this.strCustomer = value;
}
}
}
}

View 1 Replies

Sorting A Gridview Alphabetically When Columns Are Codes?

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

.net - Sorting Defaults To Using All Columns, In The Order The Appear In The Model?

Feb 11, 2010

explain what the Dynamic Data team was thinking when they designed grid sorting in Dynamic Data scaffolded tables? Sorting defaults to using all columns, in the order the appear in the model, often arbitrary very counter-productive.We've just had a run in with the 'out-of-the-box' sorting, and solved it with a simple SortExpression attribute on MetaTables. Another, even simpler solution would have been for them to avoid any sorting, allowing the DB to provide a default order based on clustered index.

View 1 Replies

Forms Data Controls :: Disable Sorting In Gridview?

Dec 22, 2010

I have a gridview that can be sorted by a few of the columns.

How do I tell the gridview to go back to the unsorted mode. That is, go back to listing rows in the order they appear in the datasource.

It's ok if this will only work the next time a rebind is done on the grid. Currently it's maintaining the sort mode after a rebind. I don't want it to do that.

View 12 Replies

Forms Data Controls :: Sorting And Paging In DataGrid Which Is Inside Asp:wizard?

Oct 7, 2010

Would it be possible to do Sorting and Paging in a DataGrid, My dataGrid is place inside an asp:wizard which is inside an Update Panel.

[Code]....

View 2 Replies

Apply Sorting Event For Gridview To Sort All Columns?

Oct 29, 2010

I have created gridview with list daatsource. I want apply sorting event for gridview to sort all columns.Here is my code:

protected void grduAdminSerservice_Sorting(object sender, GridViewSortEventArgs e)
{
DataTable tbl = grduAdminSerservice.DataSource as DataTable;

[code]...

View 1 Replies

Web Forms :: Implement Sorting Multiple Columns In GridView

Jul 23, 2012

How to sort grid view rows by multiple column?

View 1 Replies

Data Controls :: GridView Sorting On AlphaNumeric Columns

May 7, 2015

How to implement sorting in gridview with datasource present as viewstate  since paging is required,and with columns conatining alphanumeric characters( sorting as like of windows explorer)

View 1 Replies

Forms Data Controls :: Disable GridView Paging And Sorting?

Jan 17, 2011

I have a problem with the allow paging and sorting in the gridview. I have a button to export the gridview data to excel and I need to disable the paging and sorting in code behind. When I export to excel it have the link numbers of the paging and the column header as a link to sorting. I'm using VB.

[Code]....

I don't get the paging and sorting disable.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved