gridview

ASP.NET - sharing Columns between GridViews

Is there a way to define a <Columns> outside of a GridView in my .aspx file such that I can use those <Columns> in multiple GridViews in the same page? I have two GridViews that will have the same DataSource type, just with different content, and I'd rather not repeat all my customized TemplateFields in each. This seems simple enough, ...

ASP.NET gridview dynamic changing cell background

I have a griview which is bounded to a sqldatasource and changed dynamically. How do I change the background cell color based on the value? e.g., 0-0.5 green, 0.5-1 red, sth like that. <asp:GridView ID="grid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource3"> ...

Edit Delete Update button on the right of gridview asp.net

Hi Everybody, I want to place autogenerated edit delete update buttons on the right. Is it possible ? Please Help ...

Sorting GridView by row number in asp.net C# ?

I have a GridView with a row number (Container.DataItemIndex) column in ASP.NET (1,2,3,4, ...) I added it in GridView by following code : <asp:TemplateField HeaderText="#" SortExpression="#"> <ItemTemplate> <%# Container.DataItemIndex + 1 %> </ItemTemplate> </asp:TemplateField> I wanna sort the ...

a large paged GridView, Rollup and Grand Totals with SQLdataSource

If I get my dataset into a DataTable then I can do with it as I like, but I have the complexity of handling sort, paging and caching manually. I'm trying to avoid this for now. If I instead use a SQLdataSource that's all free. I need a grand total row, the contents of which I display outside the gridview. I know that I can get that b...

How to set Grid row and column positions programmatically

I have two Grids inside a Stackpanel. First grid is named as GridX. Initially inside the grid there is a 2D array of Textboxes(RowDefs/ColumnDefs). The TextBox definition in XAML is <TextBox x:Name="A1" Grid.Row="4" Grid.Column="5" TextAlignment="Center" /> I want to add a TextBlock programamtically in the same position as part of Gri...

Android Album Art GridView Question

I am new to Android development, and I am working on a media player app as a learning experience. I am currently trying to add a menu view that utilizes album art in a gridview. Here is my code: public class coverMenu extends Activity { private Cursor audioCursor; public String artistInput; private static final String TAG = "coverMe...

Telerik RadGrid with MVP Pattern

Does anyone know a solid way of implementing Telerik GridView (or any other grid view for that matter) using the Model-View-Presenter pattern. I have managed to implement some functionality but others just seem almost impossible to implement. This is so especially when working with detail tables because they logic is so tightly integrate...

Filling a GridView when datasource is a ITypedList

Hello, I am trying to fill a GridView with data provided by a ITypedList. I have a Dictionary<string,object>, and the columns & values are inside. So if the dictionary has: "Name" : "Jack" "Age" : 20 The GridView will have 2 columns, Name and Age, and the values are Jack and 20. So, the main idea from which I started was the follow...

How to make a 2-dimension image gallery with both horizontal and vertical scrolling?

Hi, I'm new to Android and I want to make an image gallery where each column is a category, and users can scroll both vertically and horizontally. I found a useful post about how to display list of images here. I'm wondering if it's possible to nest lists of image inside of a gallery view? ...

Unable to cast object of type 'CompaniesDataTable' to type 'CompaniesDataTable'.

Has anyone come across an error like the following: Unable to cast object of type 'CompaniesDataTable' to type 'CompaniesDataTable'. Here is the code that is causing the error: protected void ObjectDataSource_Companies_Selected(object sender, ObjectDataSourceStatusEventArgs e) { int x = ((Adala.CompaniesDataTable)(e....

.net textbox in gridview, unaware at postback of background-color change from client javascript

In a gridview I have the following Template Field containing a textbox <asp:TemplateField ShowHeader="true" ItemStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="Middle" ItemStyle-Width="106px" HeaderText="Actual Order"> <ItemTemplate> <asp:T...

ASP.NET GridView - How to Perform Custom Update Statements?

Hi Guys, I have an ASP.NET GridView which displays a list of neighborhoods. I wish a user (administrator) to be able to edit the neighborhood name. Now, the database is quite complex, and as such, i can't simply provide an UpdateCommand / SqlDataSource for the GridView. I bind the data manually (on first load, and on the PageIndexCha...

How to change the Header Text of Gridview after Databound?

I have a gridview I bound a DataTable with that Gridview Its dynamic so no hardcode Text in desin. I tried to change it after Databound and in PreRender of gridview but no Success. Actually there are Underscores('_') in text and I want to Replace it with space. Below is code <asp:GridView ID="grdSearchResult" runat="server" AutoGener...

Gridview filter and sorting using LINQ

I'm upgrading a project to .net 4. My GridViews are using DataSets and implement filtering, sorting and paging using an ObjectDataSource. What is the best practice to connect a GridView to a Linq query and implement sorting, filtering and paging? Do i still use a DataSet and ObjectDataSource or is there a way to use another type of Da...

How to properly filter gridview bound to sqldatasource

I am trying to populate an (editable) gridview in ASP.NET with a table from SQL. I have a SQLDataSource set up for this. I also need to have this gridview be filterable based on parameters entered in textboxes. I have tried using ControlParameters for this and it works but the problem there is when all textboxes are empty I want it to di...

Stop Gridview from treating "-" as punctuation?

I have a gridview which in one column is displaying MAC addresses. Instead of displaying them in one row, its putting them in a column as wide as the "MAC" header column. If I remove the "-"'s, then it extends the column width and displays it as one row. Is there any way to have this happen with the "-"'s included? Field in question loo...

How do I access a textbox in the footer of a gridview?

I have a .NET 4.0 web app and must be missing something obvious. I have a standard gridview with 1 column and a footer row. The footer has only 1 text box and 1 button so users can enter comments and submit them. However, I can't seem to reach the textbox. Here is the vb code... Dim strComments As String = CType(gvLog.FooterRow.FindCon...

GridView paging in C#

Hi all, I am using PageIndexChanging event for handling GridView paging in C#. But don't know how can to use PageSize/PageNumber/PageCount there. In other word my code is forced to return all data always. Note following code: protected void grdList_PageIndexChanging(object sender, GridViewPageEventArgs e) { grdList.PageIndex = ...

Switching adapters in GridView?

I have GridView and I want to be able to switch between adapters. Context: I have data from two separate sources and I want to be able to easily switch between those. Is it possible to just switch adapters or there is other solution? ...