gridview

ASP.NET jQuery - Bound Controls

I want to use jQuery with a GridView which contains textboxes, but I'm stuck on how to get event listeners registered for every textbox on the selected row. I was thinking I could do something with a StingBuilder in the Unload event of the GridView but I can't get it working. ...

CheckBoxField in GridView won't bind to a string field in the database

How do I bind a CheckBoxField in my GridView to an underlying db field that is a string. The string is either "1" or "0" but all the same the GridView won't willingly bind to it. What do I do. What is the best way to have a checkbox in the GridView and have it get and set the string in the database (or the underlying datasource). ...

Buttons in gridview control - VS2-2008

I have a gridview control which displays data returned from DB. The datakey property of the gridview is bound to the ID column of the DB Each record in the GV had 2 buttons and one Checkbox. When either of these controls is clicked I want to obtain the row that this was clicked on and perform action depending on which control was clicke...

SQL "SELECT IN (Value1, Value2...)" with passing variable of values into GridView

Hi there, I have a strange encounter when creating a GridView using "SELECT..WHERE.. IN (value1, val2...)". in the "Configure datasource" tab, if i hard code the values "SELECT ....WHERE field1 in ('AAA', 'BBB', 'CCC'), the system works well. However, if I define a new parameter and pass in a concatenated string of values using a varia...

How to change the value of a Hidden Field in a Gridview using Javascript?

Ok I need to change the value of a hidden field in a gridview and here is what I have so far: for(var i = 0; i < gv_Proofs.rows.length; i++) { var tbl_Cell = gv_Proofs.rows[i].cells[0]; var sdiFound = false; for(var x = 0; x < tbl_Cell.childNodes.length; x++) { if(tbl_Cell.childNodes[x].id == "_ctl0_MasterConten...

How do I manually add additional rows to the bottom of an ASP.NET gridview?

I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregating information taken from the rowDataBound event, but don't...

How to set selected row in ASP.NET GridView based on DataKey?

I want something similar to the following pseudocode: myGridView.SelectedIndex = myGridView.DataKeys.IndexOf("mySpecificKey"); I've done some Intellisense exploring, but I haven't found an obvious way to do this. I would want to set SelectedIndex to -1 if DataKey was not found. ...

Displaying International Text

I am looking to create an ASP.net page that will have a control like GridView or Repeater and the data to be displayed in this page can be either unicode or Utf-8 . I am really struggling to display languages like Hebrew and some asian languages. How do I show any type of language on the ASP.net page?? I have tried the meta tag option ...

Setting GridView header text to wrap as directed.

I have a GridView that has columns such as: | A | B C | D E / F | I want these to be wrapped in a particular way - that is, I do not want to leave it up to the browser to work out whether to wrap or not depending on the column width. So in the above example I may want the following: | A | B | D ...

How do I get the GridView Control to use post backs for paging inside an update panel?

I have a GridView Control that for other functionality has to be inside an update panel. The site is using the Ajax Control Toolkit and the "EnableSortingAndPagingCallbacks" property on the Grid is set to false. However, when I execute a paging call it is still doing it as a callback instead of a postback. How do I fix this and get the p...

GridView - Show headers on empty data source.

In C# how do I still show the headers of a gridview, even with the data source is empty. I am not auto generating the columns as they are all predefined. Currently what I am doing is the following. Get a DataTable back from a stored procedure, then set the DataSource of the gridview, and then call DataBind(). This works fine when I...

WPF GridView with a dynamic definition

I want to use the GridView mode of a ListView to display a set of data that my program will be receiving from an external source. The data will consist of two arrays, one of column names and one of strings values to populate the control. I don't see how to create a suitable class that I can use as the Item in a ListView. The only way ...

Infragistics UltraWebGrid - Footer Totals

I am currently using the UltraWebGrid control of Infragistics and I am displaying the sum of values of a column in the footer. The problem is that, since I am using paging, the total displayed in the footer is being calculated by the values of the current page only, but I want the sum of all the elements in the source, not just the c...

SQL Login failed when enableviewstate = false

Good day, I'm having a problem with asp.net 2.0 viewstate. Basically, I want to disable the viewstate for a gridview. However, when I do so, as soon as there is a post-back, before even getting into Page_Load, I get a 'Login failed for user sa ...'. If I enable the viewstate back, everything runs smoothly. In PageLoad, I set the conn...

Binding gridviews to viewstate until being able to write to database

I recently began working on a project which has many gridviews on a single page. During creation of a new record, the user needs to be able to add/remove/edit these gridviews and then save to the database at the end. The problem with this obviously is that there is no datasource to bind the data too until after its written to the databas...

UserControl causing loss of textbox content in Gridview header

All, My problem is that my gridview header that contains textboxes etc. that users can type into is somehow losing the content of those textboxes when the user forces a postback - but only if I have a user control in the header. This is using .NET 2.0. I've created a basic gridview that binds to a generic list datasource. I've added a ...

How to obtain a copy from a gridview?

Hi Folks, Im trying to get a completly data copy from a gridview, itryed clone(), tryed cast DataView from DataSouce, but always get nulls or cant get the data, please exists a way to copy data from gridview, modified it and then reload it? or modifyng directly some rows in the gridview? thanks in advance! ...

How to set columns widths in a GridView control to the widest necessary width

I have a gridview control that can get loaded with multiple pages worth of data. When I switch pages, the columns widths will change to accommodate the largest value in the column for that page. If possible, I would like to set the widths of each column to the widest necessary width for the entire dataset. ...

ASP.NET toolkit Accordion double click issue

I am using a accordion control which has nested gridviews within the content section and a series of buttons. When the page is first loaded, it requires 2 clicks before any button or linkbutton's events are fired. For the buttons I have hacked together a fix using external buttons which I invoke via javascript, however for the gridview...

Saving GridViewRow data before changing it (Client Side)

Im working with C# 3.0, GridViews, so my idea is the following "Save actual data from gridviewA in some local var, then perform changes in real context and finally bind them all again in the same GridView": (steps) 1) I Have GridViewA with following columns : CodeClass Description Price Appointment 4798 Arthro Re...