Centering A Sortable Row Header In The GridView?

Mar 15, 2011

I cannot seem to center the header text of a column in my GridView if it is sortable. The html output is much different for a sortable column (it seems to place a table inside of the td column).

Any thoughts on what can be done to get this centered?

I put the html ouput in a jsfiddle here ... [URL]

I have tried the following code on the grid view with no success. Bear in mind that the bound fields are server controls I designed but they do not affect the header text in any fashion:

<sc:DateBoundField DataField="LastLogin" SortExpression="LastLogin" HeaderText="Last Login"
HeaderStyle-Width="125px" ItemStyle-Width="125px" HeaderStyle-HorizontalAlign="Center" />
<sc:SCommandButtonField Command="Change" ItemStyle-Width="100px" HeaderStyle-Width="100px"
HeaderText="Change" HeaderStyle-HorizontalAlign="Center" Image="img.axd?ico16=edit" />

View 2 Replies


Similar Messages:

Forms Data Controls :: How To Make A Gridview Header Fix And Sortable

Mar 25, 2011

how to make a gridview's header fixed and sortable. All the solutions I've seen do one or the other, but not both. If I put the header in a separate table, I don't know how to make it sort. None of the CSS options I've seen work either.

My gridview isn't anything special, but it is databound via a data accessor in c#.

Here's the grid:

[Code]....

And the code behind:

[Code]....

View 6 Replies

Data Controls :: Search DropDownList And Textbox With Sortable Header In Custom Paging In GridView

Apr 27, 2016

I am going to use this article but I don't know how to add the Search which is the dropdownlist and textbox

The data in dropdownlist is ContactName and CompanyName

[URL]

Also I would like to know how to sort the gridview in Header

View 1 Replies

MVC :: Sortable Table / User Click On The Column Header And Sort The Column They Want?

Mar 25, 2011

i have a table which showing the food data from my Model, including Name, Amount, Storage and Expiry Date. I wish to either:

1. Let user click on the column header and sort the column they want

2. Or default showing the food which almost expired on the top of the table

View 4 Replies

Forms Data Controls :: Sortable Aggregated (computed) Column In A Gridview?

Jan 11, 2010

I have stumbled into a problem in which Im having a hard time solving. I have a linq data setup(based on a mssql) where a Purchase Order contains a number Equipments - each equipment has a price. I have a gridview that shows the summed price of the equipments that are included in a Purchase Order. This sum is currently being calculated on RowDataBound through a "listOfEq.Sum(Eq => Eq.PurchaseOrderPrice);" expression which works without any problems. My problem is that I want to be able to sort the gridview based on this summed value, which I cannot do with a normal sortexpression. My next thought was to create a function in my database to calculate the sum instead and then use this is my data basis for the summed column. I have created a function like this:

[Code]....

I want to create a sortable column based on this data. My thought is something like this:

[Code]....

Displaying the correct information is not a problem, however creating the sorting is. Im not sure what to put in the SortExpression. Anybody got an idea of what to do? Perhaps I am forced to use a computed column for this however I dont know to create this column when its based on another table. If this is the case, any idea about how to do create a computed column thats based on data from another table?

View 2 Replies

Forms Data Controls :: How To Display A Header Of Gridview As A 3D View Color Header

Jan 4, 2010

how to display a header of gridvew as a 3D view color Header?

View 14 Replies

Forms Data Controls :: Adding The Custom Header Control To The GridView Header?

Jan 21, 2010

Scenario:
I have a Gridview where I want to handle the Sorting in a custom control that I've added to the header.
I've added this control to my GridView's Header via OnRowCreate event handling. I want the Sort Expressions to persist session to session (via Webparts Personalization)

Here is what I have for adding the custom header control to the GridView Header

[Code]....

This works out well for adding the control, but I can't get anything to persist because these controls are creating initially via postback (per the event) and re-created on all subsequent postbacks. I can't add an If(!IsPostback) because the controls are initially created on the gridview's postback (well at least thats how it's acting when I put it in there) If I were to add this control via the ASP page, not via the Codebehind, I would be able to persist the control. If I try to treat it as though everything is setup correctly, and assign my custom control's controls to [Personalizable], I get a runtime error telling me that I can only have webpartzones in or before Page_init (I'm guessing this is due to when/where the
gridview hits the OnRowCreate event). If there is some fundimental logic I'm missing, or best practices that I'm moving away from,

View 1 Replies

Forms Data Controls :: Gridview Column Header Button Instead Of Header Name?

Nov 28, 2010

is there anyway i can add in the gridview in header column name a button instead of label ?

column name 1 column name 2 column name 3 button

i am using checkbox column in item template for the button ,i wish after selecting checkbox for some row to click on the button on the header !!

View 2 Replies

Forms Data Controls :: GridView Header / Change The Header Based On The Session Variable

Feb 16, 2011

I am using the following code to change the header based on the session variable

[code]....

View 2 Replies

Data Controls :: Pass GridView Column Header Values To Another Pages Table Header

May 7, 2015

How to pass gridview particular column values to another page's table header...

View 1 Replies

Login Control Not Centering?

Mar 1, 2010

I have an aspx Login control and I would like to center it on the screen.

How can i accomplish this? I've tried applying text-align: center on it.

View 2 Replies

VS 2010 - Centering Page With Min And Max Widths

Nov 1, 2010

I want my webpage to be centered in the browser, but at the same time also have a minimum and maximum width.

I know I can center the page (well, the div element really) by setting the margin-left and margin-right CSS properties to auto. This works just fine and the page is centered, with room to spare on both the left and right side.

But, if your monitor is wide, this space is wasted, and I want the page to expand in that case. So instead of using 'auto' for the margin-left and margin-right properties, I used a fixed margin of 50px on both sides. Now, the site expands and shrinks with the browser nicely, and it is still centered.

However, I don't want the site to become too small, otherwise elements start overlapping. So, I set the min-width property in the CSS to 800px. This still works fine. I can resize the browser and the page shrinks, until it hits 800px then it simply stays in place.

The relevant CSS at this time is:

Code:

.page
{
margin: 10px 50px 10px 50px;
min-width: 800px;
}

A new problem now occurs when the browser window is too large. In that case the contents of the site are all on the left side, and the right side of the page (the page mainly consists of a grid) is empty. So what I want now is to also set a maximum width. I tried doing that by simply setting the max-width property in the CSS (to 1650px):

Code:

.page
{
margin: 10px 50px 10px 50px;
min-width: 800px;
max-width: 1650px;
}

This doesn't work the way I want though. While it doesn't expand the site further than 1650px, the site is no longer centered when the browser window is larger than that. The margin is kept fixed at 50px on the left, but it grows on the right side (because the page cannot grow any further).

So, I thought I could set the margins back to auto:

Code:

.page
{
margin: 10px auto 10px auto;
min-width: 800px;
max-width: 1650px;
}

While the page is large enough, this works just fine, the page is centered. However, if I now shrink the window again, so that the width of the page is below the max-width, there is no longer a margin on the left and right sides! The page just sits right against the browser edge...


What I basically need is a way to set the margin to auto, but with a minimum margin of 50px. Is that possible?

View 14 Replies

AJAX :: UpdatePanel Content Not Centering

Mar 9, 2011

I'm having an odd problem. I have a <td> that is set to align it's content in the center. There is a label at the top of the TD that is centered. But then I have an UpdatePanel, and the content of the update panel is not centered. I tried clearing the browser cache, and everything in between but for some reason all of the contents (two GridViews) of the UpdatePanel will not center.

View 3 Replies

Forms Data Controls :: Gridview Header Css / Set The text Color To White For The Header Only The Non Bound Columns Go White

Aug 13, 2010

i have a gridview bound to sql datasource with template fields binding the columns. I have set the Header Style to a css class. I have 3 columns not bound to data as Add, Edit and Delete. When I set the text color to white for the header only the non bound columns go white. The bound columns are BLUE like hyperlink. Any one know a way round this. (If I set the style in the gridview the all columns are white. Want to set in external css file).

[Code]....

View 1 Replies

Forms Data Controls :: Centering On Screen The Edited Record?

Apr 18, 2010

How to make the selected record (area) for editing to be in the center of the screen?

I have a GridView with custom Edit functionality. I have panel, table and some controls for updating in the EditItemTemplate area. When the user selects to edit a record, I want the edited record area to be aligned in the center of the screen. What is happening now is, with the gridview having many records; the user has to navigate to find where the edit box displayed!

View 7 Replies

AJAX :: UpdatePanelAnimationExtender Animation Not Re-centering After Window Resize Or Page Scroll

Oct 28, 2010

I want my UpdatePanelAnimationExtender animation to always show in the center of the browser window even after a window resize or page scroll. The animation does re-center horizontally after a window resize but not vertically. It does not re-center after either a vertical or horizintal page scroll. I get the same behavior in IE 8, Safari & Firefox. Below is my code:

[Code]....

View 1 Replies

C# - Easiest Way To Make Only One Column Sortable

Oct 12, 2010

I have a datagrid with sorting. I set enable sorting to true, but that makes every column sortable. Is there a simple way to make it so that only one column header can be clicked for sorting? I feel like there should be a simple and quick fix for this, but who knows. some code:

<asp:GridView ID="ProductsGrid" runat="server"
AutoGenerateColumns="False" Height="323px"
style="margin-top: 23px; margin-left: 0px;" BackColor="White" CellPadding="0"
Width="1210px" OnPageIndexChanging="gridView_PageIndexChanging"
onrowdatabound="ProductsGridView_RowDataBound" AllowPaging="True"
PageSize="25" AllowSorting="True" OnSorting="ProductsGrid_SortCommand">

I then have several columns. Is there something I can set in the code for the column to disable all others or only make one sortable?

View 1 Replies

JQuery :: How To Get At The Data After Doing A .sortable Serialize

Feb 3, 2011

How do I get at the data after doing a .sortable serialize? Here is my code :

[Code]....

View 1 Replies

JQuery :: Sortable Recieve Events

Feb 10, 2011

I have li list with jQuery sortable attached to it. but the receive function is never executed. When I drag list item 10 to the 2nd position the way i expect this code to execute is to execute the receive function. but it never gets executed.
[Code...]

View 1 Replies

Web Service Example With JQuery UI Sortable Serialize Method?

Dec 22, 2010

am building jQuery UI sortable to store order in the database using serialize and ASP.NET Web Service. I know how to do it in php, but I am not sure how to do it in ASP.NET... I tried googling with little success.

$('#mylist').sortable({
handle: ".handle",
axis: "y",

[code]...

View 2 Replies

JQuery :: Call Function From Sortable And OnDrop

Feb 3, 2011

I am using .sortable on a div that I have. What I want to know is, how do I call a function when the drop event occurs? Here is my code at the moment :

[Code]....

View 2 Replies

DataSource Controls :: Get Around The 'has No Supported Translation To SQL' For A Sortable Field?

Sep 12, 2010

There's an issue I'm having in several areas of my ASP.NET site, but am using the following as an example. If I can get it solved, then I'm reasonably sure it has applications elsewhere.Let's say I have a gridview based on the aspnet_membership table. Its LINQ datasource is aspnet_membership, which exists in my datacontext.By itself, it works GREAT in the grid.However, showing UserId in and of itself doesn't have much meaning; I wanted to include UserName.So, in my Public Partial Class, I created a read-only property UserName:

[Code]....

This retrieves and displays the correct data, no problem there.However, I'm not able to sort on that new column. When I attempt to do so, I get the following error: The member 'aspnet_Membership.UserName' has no supported translation to SQL.A workaround is, of course, to use a Sql datasource. But as I'm learning more about LINQ and the partial classes, I want to learn how to do it the correct way.

View 1 Replies

Sorting (rearranging Order) Of A Photo Album Using JQuery Sortable?

Feb 6, 2011

I have a photo album gallery within my website and would like to allow users to sort the order of their photos within an album. After looking at very different ways I came across this example http:[URL]Admin=true which is exactly what I need.

The photo are stored in the uploads directory and details in the database. The images are displayed using the ListView as shown below:

<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" GroupItemCount="15">
<LayoutTemplate>
<table id="groupPlaceholderContainer" runat="server" border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse; width: 100%;">
<tr id="groupPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr id="itemPlaceholderContainer" runat="server">

[Code]....

View 1 Replies

Forms Data Controls :: Paged Sortable Lists And Efficiency?

Jan 13, 2010

I need to make a large Ebay-style list of listings (think of the page that comes up when you search for something in Ebay, with a photo, title, one-line description, price, that's paged, and sortable). My limited experience with DataGrids in the past always resulted in what felt like a sluggish page to me, but I'm not sure if it would have been faster if I had pieced it together with a data reader instead.So I'm wondering before I even get started, what is the fastest / most efficient way to retrieve and manage this data.Is it more efficient at runtime to use a DataGrid, or to write the paging and sorting in more manually and use a DataReader, or another way?Ebay manages to get thousands of listings to display very quickly, but they've obviously got a lot of manpower to squeeze every last bit of performance they can out of the site, and good high-powered servers.

View 5 Replies

Forms Data Controls :: Gridview Header And Footer Should Not Move While Scrolling Gridview

Sep 13, 2010

i am using Grid view. when ever bulk data is there in Gridview, Header and footer must not be move..

how can i do that.

View 3 Replies







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