gridview

GridView - Sorting Enum in Alphabetical Order

When sorting on a column in the GridView bound to an Enum, it sorts by the order of the Enum. I need it to sort by the string representation of the Enum. Here are the options I have seen, of which I like none of them. Reorder the Enum in alphabetical order - Bad because now the presentation is relying on the Business and Data Access ...

How to use both DataSource and DataSourceID in gridview

work on C# asp.net vs05.i need to save some value and show them on the gridview.So under the button event i write a code that save value ,and show on gridview.I can save value but problem occur when show on gridview.So i use the DataSource .I also set the GridviewTask-->Choose Data Source--> DataSourceID ,because user need to edit infor...

ASP.NET:Paging when deleting rows

I have a datagrid where a row can be deleted (using ajax). I'm have problem with the pager in the following scenario: Lets say my PageSize is 10, I have 101 rows so that's 11 pages with the last page with an single element. Let no assume that I'm on page 10 (PageIndex=9) and delete a row. Then I go to the 11'th page (who's now empty an...

delete row's selected in Gridview in Asp.net

This Code has a problem , that I don't know what is that . this code must Delete row of gridview when selected. I set AutoGenerateSelectButton = true then write this Code that don't work and have Exception from foreach. protected void IDeletebtn_Click(object sender, EventArgs e) { foreach (GridViewRow Items in InboxGrv.SelectedRow)...

ASP.NET Gridview horizontal alignment in Internet Explorer

I'm trying to have one unified location where I may edit how my gridview columns will act and align. Specifically looking at the headerrow. I have certain columns containing text values, those should be left aligned values and headers. Other columns contain integers and should be right aligned both values and headers. "On the first day"...

GridView.PageIndexChanged event

I thought GridView.PageIndexChanged event signals that ObjectDataSource retrieved rows for appropriate page, but I’m probably wrong, since this event happens before ObjectDataSource control rebinds to data source. What this event signals then? Only that GridView now knows what values will parameters maximumRows and startRowIndex have? ...

How do I change the value of a extended ButtonField?

I want to change the value of the text in a ButtonField depending on other factors. Some code: public override void InitializeCell(DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex) { base.InitializeCell(cell, cellType, rowState, rowIndex); bool isDataRowAndIsHighlightFieldSpecif...

WPF - GridView.GridViewColumn two lines per row?

Hello is it possible to have a ListView -> ListView.View -> GridView -> GridViewColumn with "two rows" per row. eg.             COLUMN 1 | COLUMN 2 ROW 1 blah          | data             blah ROW 2 etc            | more I have tried unsuccessfully to use a Cell template but the item inside the template doesn't resize when its ...

Dynamic control type in InstantiateIn() method of ITemplate based on properties of DataItem. Is there a way?

I have a simple GridView; something like this for a regular Item or AlternatingItem row: +----+-------------+----------+ | ID | Description | Value | +====+=============+==========+ | 01 | Some text | 0.082 | +----+-------------+----------+ | 02 | Some text | Yes | +----+-------------+----------+ | 02 | Some text | 9/4/...

GridView dynamic column width in WPF

<Window x:Class="GridViewSample.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" > <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <ListView Name="CheckoutList" Margin="0,0,8,0"> <ListView.View> ...

Grid View Fixed Header for horizontal and vertical

.Freezing{ position:relative ; top:expression(this.offsetParent.scrollTop); z-index: 10;} for the above code do anyone know how to modify it so that it can be apply to fixed header for horizontal and vertical scrolling!!! any suggestion would be appreciated!!!!! ...

Display a property of a many-to-one entity on a gridview

Hello! I have a database with two tables, ProductLine and Supplier. ProductLine contains the foreign key SupplierId, while Supplier has a field "Name". Table ProductLine: ProductLineId(PK), Name, SupplierId(FK) etc. Table Supplier: SupplierId(PK), Name etc. In my program I have two classes, ProductLine and Supplier, of which Pro...

Sorting a GridView based on weights in another database table...

I have a GridView being populated from a non-SQL database that we use internally. One of those fields is a stockroom location. (Example: AAA, AAB, AAC, etc.) In another database (SQL) I keep a list of all stockrooms and give them a weight. The weight is just an integer; the higher the integer, the further away the stockroom is. I need ...

Achieve equivelent of T-SQL ROW_NUMBER+OVER in Linq

Is it possible to achieve the following in Linq? What I am trying to get is a list of records that have a column that displays the row number starting with 1. I need to display the row number in a gridview control to denote visually to the user how many rows have been populated. Why you ask? The user needs to enter an exact number of...

ASP.NET GridView Button Event

Hi, I'm trying to trigger a button event in a gridview. I created a gridview with the following code: <asp:GridView id="ItemsGrid2" BorderColor="black" CellPadding="3" BorderWidth="1" HeaderStyle-BackColor="DarkSlateGray" HeaderStyle-ForeColor="White" AutoGenerateColumns="false" AllowSorting="true" OnSortCom...

Accessing ChildControl Values of a GridView

Hi guys, I tried to search for this question and plenty results come up, but not exactly what I'm getting, so here it goes: I have a simple GridView control and I want to access the value of the child controls once submited I'm doing this: <asp:GridView ID="gvQuery" runat="server" GridLines="None" CellPadding="5" CellSpacing="5" ...

Using IE DX Transforms in gridview rows

I am trying to apply a DirectX gradient filter transform to the selected row in an ASP.net page gridview. In the RowDataBound() event I am applying the approprate style (whihc I know works in other situation), and the added row attributes for 'onmouseover' and 'onmouseout' to enable and disable the filter array element(s) so when the mo...

asp.net vb.net gridview - can't sort!

I try to make this gridview sortable, but it simply doesn't work, anyone know why? Dim sql As String = "SELECT Product_ID, Code, Trade_Name " sql = sql & "FROM Product " sql = sql & "WHERE Category = ? " Dim conn As String = WebConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim dad As New OleDbDataAdapt...

WPF: How Do I edit the column properties of a base/parent class in the child class through the property editor/XAML?

I have created a class called ProductionDataUserControlBase and it derives from class UserControl. This base class has no XAML. Its purpose is to act as a base class for a grid that I encapsulate inside the class so that it can be modified when the class is inherited later. Inside the constructor of the base class, I also create the colu...

GridView Page in UpdatePanel dropping 1 row

I have a basic gridview with paging enabled. I have 11 rows in my database and the gridview's page size is 10. When I come to the page, it shows 10 rows, and in my pager, it shows me on page one with a link to a second page. When I click on the second page, it refreshes the page and goes to page 2 and displays the 11th, lonely row. Whe...