gridview

ASP.NET GridView Column - formatting telephone number

I am adding a column to my gridview in code-behind as follows: field = new BoundField(); field.HeaderText = "Phone Number"; field.DataField = "PhoneNumber"; field.HtmlEncode = false; field.DataFormatString = "{0:###-###-####}"; gridView.Columns.Add(field); However, the DataFormatString is not working because the PhoneNumber field is a...

Asp.net gridview, get boundfield value in code behind when in edit mode

In asp.net (c#) I'm using a gridview and edit mode to make it easy for the user to change values. But I need to check the value that the user enter in OnRowUpdating, when using this code, I always get the old value not the new value I entered. How can I get the new value? <asp:GridView ID="MyGridView" OnRowUpdating="MyGridViewUpdate" Da...

asp.net sorting Gridview custom datasource type

It seems that the only way to sort my gridview is by binding it to a datasource or datatable. I binded mine with a user custom list type and in this situation i can not convert my gridview datasource to a datatable or dataview. Is there any fast way, how to do this? Regards ...

execute sqldatasource with button

I have two queries that I want to be able to run on a page. I have a button, gridview and sqldatasource at the top of the page and another button, gridview and sqldatasource with the second query at the bottom. How do I associate the buttons with their particular grid and datasource. right now when I click either button, both gridview...

Validate a Gridview

I have a gridview that I want to validate when it is in edit mode. how do I do this? Below is my Gridview and below that is my first attempt. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px...

javascript:history.back() on pages and not events

I have an ASPX page that contains a link to "javascript:history.back()" The problem is that page contains a gridview that changes with events (ex. a column is sorted). Now when I click the link to "javascript:history.back()", it just reverses the event but instead I want to go back to the last page (bypassing all the events). Is there ...

EditTemplate property of asp:GridView control.

Hi All, I have a asp:GridView and in there i have two columns , in one column i want to show label but when i click an sdit button i want to show a drop down list in that particular column, i have created the grid view like following: <bw:GridView ID="grdProducts" AllowPaging="True" PageSize="5" AllowSorting="True" CssClass="DGTable...

How to refresh a GridView/LINQ data source from textbox onchange event

I've been having troubles getting my textbox to refresh a GridView from the onchange event. The GridView is linked up to a LINQ data source and the LINQ data source has a Where Parameter UserId that it gets from the textbox... Here's the code: <asp:Label ID="label_UserId" runat="server" Text="Search by User Id: "></asp:Label> <...

Download a file within a listview nested in an UpdatePanel?

How can you download a file from within a listview (or gridview) that is nested within an UpdatePanel? ...

How do you style a WPF GridView Header?

...

problem with paging my gridview

I have a gridview inside of a div that is displayed with ajax. I have the following. <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/icon_info.gif" /> <div id="moveMe" style="display:none"> <div style="float:right;"> ...

ASP.NET Retrieving GirdViewRow.DataItem on arbitrary post back

Hi there, Is there any way to get a GridViewRow's DataItem property in the handler for an arbitrary post-back?? All DataItems have values during the RowDataBound event, but are null in Button_Click for example, im assuming because the Grid is in the process of being databaound in the first event. I do some formatting on the fly in Row...

Free or open source Tree-grid for C#?

Is there any Tree-Grid component that is freely available for a C# project? ...

Auto-saving via XmlHttpRequest from EditorGridPanel in ExtJS 3.0?

I have an EditorGridPanel in Ext JS 3.0, populated via HttpProxy and JsonReader, and I have an editable column "working"--I can edit the value and it flags it as dirty. Now, how do I get it to, after a cell has been edited, send an XmlHttpRequest to the server with a few base parameters, the row's ID field, the name of the column change...

If DataBind() is called inside Page_Load(), then SqlDataSource doesn’t perform updates

If I bind GridView (via DataSourceID attribute) to SqlDataSource and set SelectCommand and UpdateCommand attributes, then everything works perfectly. But I’ve noticed that if I, for whatever reason, also manually call DataBind() inside Page_Load(), then SqlDataSource doesn’t perform any updates, even though SqlDataSource.Updating and S...

GridView and empty datasources

I've got a gridview and I want it to display the header row even if there isn't any data in the collection that it's binding to. Any ideas on how to do this neatly? ...

Binding to a sum of SelectedItems in WPF GridView

I have a GridView that contains a list of files, created dates, and file sizes. Below the grid I have a textblock that says "X Files Selected. Y MB". I can bind to SelectedItems.Count just fine, but can I easily bind to the sum of the file sizes for those that are selected? The question marks below should be the sum of the SelectedIt...

GridView Editing With Mootools

I've a grid view which has BoundField columns, an Edit link and a Delete link. For the Edit link, is it possible to call a modal box by MooTools with fields in it? Note that previous values of the fields are displayed before making an update. Thanks so much. ...

I want to add a control to gridview if column is Null Is it possible in asp.net 2.0

Hi I have a gridview with data. Before filling the gridview i want to validate if column is Not null. If null i want to add control to gridview. Is it possible Thanks in advance ...

( DetailsView control )Insert mode using EditItemTemplate as a blueprint

Hello, I’m trying to learn the inner workings of DetailsView object when operating in Insert mode, but it’s a bit confusing. 1) Assume DetailsView is bound to ObjectDataSource: A) When DetailsView’s field only defines ItemTemplate and EditItemTemplate, but no InsertItemTemplate, then when control is put into Insert mode, field ...