gridview

Union two List

Hi there, i want to union, merge in a List that contains both references, so this is my code, how can i define a list ready for this porpouses ? if (e.CommandName == "AddtoSelected") { List<DetalleCita> lstAux = new List<DetalleCita>(); foreach (GridViewRow row in this.dgvEstudios.Rows) ...

ObjectDataSource Gridview Insert Fails W/ Empty Values Dictionary

I have a gridview to which I have created an Insert Template in the footer row. I have an ObjectDataSource which is bound to a business object. I have an OnInserting event handler which never gets fired. The program encounters an error once I call .Insert on the ObjectDataSource. The error I receive is that there are no values and th...

Fixing a slow GridView

I am trying to determine why an asp.net grid view is so horribly slow. The grid view is contained in a custom sub class that adds a custom pager and does some special formatting. Further, the custom grid view is contained in a user control that puts the grid view in an update panel and combines it with an object data source to making the...

How to export an asp:GridView's TemplateField fields to excel in c#?

Does anyone have an example (code or a link) that will allow me to export a gridview template field to excel? Here is an example of what I mean. Assume I have the following GridView Declaration: <asp:GridView Id="gvResults" runat="server"> <Columns> <asp:TemplateField HeaderText="Contact Info"> <ItemTemplate> ...

Why doesn't globally declared DataTable retains its value?

I have an aspx page with a gridview. In my page load event, I load a datatable with all the data like so: HistoricalPricing historicalPricing = new HistoricalPricing(); DataTable dtHistoricalPricing = new DataTable(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { dtHisto...

Problem in GridView PostBack Events

Hear in row databound onclick event its Printing 'Hi' when i click on any row ...But it has to print 'Hi' on click of 15th row only .....I am facing this problem ...plz reply. protected void dtvExDetails_RowDataBound1(object sender, GridViewRowEventArgs e) { if (e.Row.DataItemIndex == -1) return; e.Row.Attributes.A...

Gridview HTML row ID incorrectly created

All, When my gridview binds to its datasource (set programmatically) and generates the HTML, the row ID's are coming out in the HTML as the same for every row ... i.e. they are not unique. I expect this: <select name="ctl00$ContentHolder$list$ctl03$EquipmentTypeList" id="ctl00_ContentHolder_list_ctl03_EquipmentTypeList" style="width:16...

Rebinding GridView using LinqDataSource

I have a gridview that is using a LinqDataSource for it's datasource. I've added a FooterTemplate so users can insert new records. The Add Button has a command name that puts the values in a Dictionary list and then calls the LinqDataSource.Insert() method. This works fine. But the gridview never refreshes automatically with the new ...

ASP.NET GridView RowIndex As CommandArgument

How can you access and display the row index of a gridview item as the command argument in a buttonfield column button? <gridview> <Columns> <asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" Visible="True" CommandArgument=" ? ? ? " /> </Columns> </gridview> ...

ASP.NET GridView sorting on a calculated field

I have a DataBound GridView. However I have one column where the value comes from a calculation in the code behind - it is displayed within a TemplateField. How can a sort my grid based on this calculated value ? ...

Link gridviews for paging ??

I implemented HectorMac's Suggestion, http://stackoverflow.com/questions/254075/aspnet-grid-with-frozen-columns , but i have paging enabled since I have many records... I wanted to know if anyone has, or can guide me how I might link the two gridviews, so when I advance the page on one grid, the other will advance as well... Thanks ... ...

ASP.NET - Disabling validators in a gridview using javascript

Further to my question on disabling validators using javascript - http://stackoverflow.com/questions/400346/disable-asp-net-validators-with-javascript ... Does anyone know how to pass through a gridview in javascript to dynamically disable the validators on each row. I now understand that I'll need to use ValidatorEnable(validatorContro...

Gridview within an UpdatePanel does not render in the DOM

I'm using the ASP net Ajax toolkit and have a GridView within the UpdatePanel, everything works fine. When I attempt to run some jquery against the table that should be generated, there isn't any sign of the gridview (or table HTML) in the DOM that is returned. I am assuming this is all done by ASP generated Javascript? How can I perf...

ASP.NET: GridView value set to null when column is not visible

I'm using a list of objects as the data source of my GridView and when I set columns to not be visible the updates fail because the value of those columns is changed to null (and the column doesn't allow nulls). The values do exist when the columns are visible but I really don't want to display these columns because, for the most part,...

Updating gridview using ado.net and then changing edit mode

I simply use commandName = "Edit" to put the gridview into edit mode. Then i use a special command ("CallUpdate") so i can update in a special function. All of this works great except after i call the update and the page refreshes IT IS STILL IN EDIT MODE. How do i work around this? ...

Show number of results in gridview based on dropdown?

I have a datatable which returns around 30,000 records. I am displaying these records in an ASP:GridView control. I have a dropdown control in which I want the user to be able to select the number of records to display in the GridView. The default should be All, but it could also have values such as 20, 50, 100 for example. I am not q...

GridView Vs. HTML Table (ASP.net 2.0)

For full control of your application, do you prefer a GridView or a HTML table? And why? For instance, I need to create on-the-fly hyperlinks-per-row in a GridView/HTML table. What object would be more easy to add that feature (or others like this one)? Note: I'm creating programmatically my datasets ...

Postback destroys user controls in my GridView columns

I have a ASP.NET GridView that uses template columns and user controls to allow me to dynamically construct the datagrid. Now I'm implementing the event handler for inserting a row. To do that, I create an array of default values and add it to the data table which is acting as a data source. However, when my OnLoad event is fired on post...

Access Non-Public members of a GridViewCommandEventArgs object

I have a gridview on my aspx page set up the OnRowCommand event using a series of ASP.NET LinkButton object to handle the logic using the CommandName property. I need to access the GridViewRow.RowIndex to retrieve values from the selected row and notice it is a non-public members of the GridViewCommandEventArgs object while debugging th...

Implementing sort/page feature when using POCOs with ASP.net Data Controls

I am not a big fan of datasets so I use POCO to return data. I have achieved paging and sorting using custom methods that I create for a POCO type that work on page size and give me a set of the complete POCO collection at a time, I use methods that check for name of the DataItem clicked and sort order to do that sort. Creating such meth...