Tag | GridView Posts

A few time ago i've write an article explaining how to use iTextSharp. Check it here: http://geekswithblogs.net/g... In this article, i'll show how to use headers. You just should follow this article if you're using iTextSharp 5.x or above. Other versions uses the object HeaderFooter. The last releases, instead of using an object to create the header, uses events. There's a list of existing events in iTextSharp: ...
There are times that we need to set the border color of the GridView just like in my case, I was told to set the border color of GridView to a particular color instead of the default black. What I did is simply use the BorderColor property of the GridView and set it declaratively like below: <asp:GridView ID="GridView1" runat="server" GridLines="Both" BorderColor="Red"><as... Here's how it looks when we run that one in the browser. Firefox 3.5 Safari 5 IE 8 Noticed that in IE8 ...
In this article i'll show very quick how to write an .pdf document in .NET. First of all, download the itextsharp library and add the reference to your project: http://itextpdf.com/ Now create a new class, like pdfHandler.cs and a method to generate the .pdf document. With itextsharp we work with a few objects to generate the pdf. The Document will handle with the .pdf document, and will create automatically the pages. The PdfWriter is responsable for the .pdf file. It defines where it's saved. In ...
After I renamed the page and namespace for my aspx page, I started getting a compilation error: “The name 'GridView1' does not exist in the current context”. This was odd since the aspx codebehind and inherits attributes were in sync with the aspx.cs and aspx.designer.cs files. So what was wrong? During my rename operation, Visual Studio (or possibly ReSharper) excluded the designer file from my project. I hadn’t noticed because I usually work with the “Show All Files” option enabled in my solution ...
El manejo de la información hoy en día es importante, pero lo es aún más la forma en que se controlan los accesos a la misma. Hoy veremos como crear reglas de accesso a nuestras aplicaciones web basadas en asp.net utilizando el membership provider que nos proporciona asp.net de una forma fácil y rápida. Para empezar, agregamos una nueva página a nuestro proyecto asp.net y definimos lo siguiente <table class="webparts"> <tr> <th> Website Access Rules</th> </tr> <tr> ...
In my previous post here I have demonstrated how to add dynamic rows in Gridview with a combination of TextBox and DropDownList. Just in case you need to validate empty TextBox values before adding a new row to the GridView then here's a JavaScript function that you can use for validation: function ValidateEmptyValue() { var gv = document.getElementById("&l... Gridview1.ClientID %>"); var tb = gv.getElementsByTagName("in... for (var i = 0; i < tb.length; i++) { if (tb[i].type == "text") ...
Few months ago I wrote a sample demo on how to Add Dynamic Rows in GridView with TextBoxes and how to Add Dynamic Rows in GridView with DropDownLists. I have had a few comments and emails asking how to do the same with a combination of TextBox and DropDownList. In this post, I'm going to show you the way on how to this. Here are the code blocks below: ASPX: <asp:gridview ID="Gridview1" runat="server" ShowFooter="true" AutoGenerateColumns="false"... <Columns> <asp:BoundField DataField="RowNumber" ...
First of all, sorry for not posting for a quite long time. I have started working on designing and developing a charity website for blood donation. So all my leisure time was diverted into that. I will ensure that going forward, I post at least one post every week. Lets get into the topic of this week, without delaying any more time. I have always been using asp:Menu and asp:Treeview for transforming the sitemaps to super cool menu which are auto generated by ASP.NET for us. But I wanted more and ...
If you are working with GridView BoundField Columns and wanted to access the TextBox control on row editing for whatever reasons (which means when you click on the Edit link) then below is an example on how to do it. Let say for example you need to change the BackColor of the TextBox on edit mode. So at PreRender event of GridView, you can do something like this:protected void GridView1_PreRender(object sender, EventArgs e) { if (this.GridView1.EditIndex != -1) { TextBox tb = (TextBox)GridView1.Rows[Gri... ...

Often we may need an auto incremental column for index on gridview, we can achieve this by adding a Template field:

<asp:TemplateField HeaderText="Index">
           <ItemTemplate>
                  <%# Container.DataItemIndex + 1 %>
            </ItemTemplate>
</asp:TemplateField>

The .NET Framework version 4 includes enhancements for ASP.NET 4 in targeted areas. Visual Studio 2010 and Microsoft Visual Web Developer Express also include enhancements and new features for improved Web development. This document provides an overview of many of the new features that are included in the upcoming release. This topic contains the following sections: ASP.NET Core Services ASP.NET Web Forms ASP.NET MVC Dynamic Data ASP.NET Chart Control Visual Web Developer Enhancements Web Application ...
When working with ADO.NET Entity Data Model, its often common that we generate entity schema for more than a single table from our Database. With Entity Model generation automated by Visual Studio, it becomes even more tempting to create and work with entity models to achieve an object mapping relationship. One of the errors that you might hit while trying to update an entity set either programmatically using context.SaveChanges or while using the automatic insert/update code generated by GridView ...
Saber quienes forman parte de nuestra aplicación es sencial, principalmente cuando deseamos hacer una "auditoria" de nuestro sistema. Cuando utilizamos el membership provider de asp.net podemos obtener esos usuarios en una lista para su identificación. Así que, veremos como podemos obtener esos usuarios en un gridivew. Algo tan sencillo como 2 líneas de código. Primeramente creamos una página asp.net y agregamos un gridview, <asp:GridView ID="gvprofiles" runat="server" AutoGenerateColumns="true" ...
create a WinForms DataGridView checkbox column via databinding on dummy a SQL column select (Cast((SELECT 0 AS Active) as Bit)) AS [myCheckBox Column]
On Wednesday, I will have the honor of co-presenting, for both The Data Warehouse Institute (TDWI) and the New York Technology Council. on the subject of Excel and BI. My co-presenter will be none other than Bill Baker, who was a Microsoft Distinguished Engineer and, essentially, the father of BI at that company. Details on the events are here and here. We'll be talking about PowerPivot, of course, but that's not all. Probably even more important than any one product, will be our discussion of whether ...
  • Legg til RepositoryItemCheckEdit under In-place Editor Repository i GridView Designer
  • Sett ValueChecked til typen integer og verdi 1
  • Sett ValueUnChecked til typen integer og verdi 0
  • Velg den opprettede repositoryItem på de aktuelle kolonnene i gridview
In this video Mohammad Azam will demonstrate how to persist checkbox selection state while paging inside the GridView control. http://highoncoding.com/Vid... ...
Visual WebGui launched a new major live demo of the platform's concepts, features and controls and the code behind them. The new Developer CompanionKit is a hige leap forward in the developer experience by allowing developers a hands-on exploration of Visual WebGui which should provide better understanding of the system and the ability to utilize the great advantages of Visual WebGui in order to develop better performing rich web applications. The CompanionKit is available online at companionkit.visualwebgui.c... ...
Eager loading with EF To Do Eager loading use Projections (for e.g. : 1: var custWithAddresses = from c in context.Contacts 2: where c.LastName == "Gupta" 3: select new {c, c.Addresses} or use Include Query Builder Methods (Include(“Addresses”)) 1: from c in context.Contacts.Include("A... 2: select c; If there is multi-level hierarchical Data then to eager load all the relationships use Include Query Builder methods like customers.Include("Order.Or... to include Order and OrderDetail ...
In part 1 of this article I talked about how Object Container Data Source (OCDS) can be modified in WCSF to make two-way binding possible with complex objects. In this part I am going to talk about different issues you might run into while using two-way data binding with FormView/GridView controls in a complex page layout and at the end of the post some really cool benefits of using OCDS. To get two-way data binding work with complex page layouts, the web page has to be broken down in the logical ...
Just a quick tip for working with the gridview in ASP.Net. If your data column contains HTML text, you've probably seen something like this in your gridview after pulling the data: <font color="red">First Item</font><br/>... color="green">Second Item</font><br/>... color="blue">Third Item</font> To have the relevant column render in HTML, just go to your gridview property pages, find the column you need rendered in HTML, and click 'convert this ...
Although the azure application will be running on the sky we still need to develop it on the ground since we would not be able to fly. In order to make it easy and simple to work with azure on local machine we need to download the Azure SDK firstly. Azure SDK extend Visual Studio 2008 and Visual Studio 2010 RC to enable the creation, configuration, building, debugging, running and packaging of scalable web applications and services on Windows Azure, and it includes all necessary assemblies which ...
If you need to use JavaScript to do a Check All on all the checkboxes in the column, be sure to use this guy's code: http://www.highoncoding.com... If your code simply change the state (...checked == true), it does not get registered and does not get passed into the code behind. Instead, follow AzamSharp's article and make sure you initiate a click() event ...
I recently ran into a business problem that I can't find any sample code online. I think I worked out a tolerable solution. The business scenario is this: All rows retrieve from the database must be in edit mode, but only some fields should be in edit mode, not all. Editing one row at a time is out of the question. User might make changes and THEN want to sort the grid. Any user input needs to be preserved. Have to use .NET control that come out of the box with Visual Studio due to maintenance concerns. ...
Here is an old trick to get vertical scroll bars for a GridView. I find this handy when the end users do not want paging but they also do not want to have a page load a GridView that is a mile long either. The code below shows placing your GridView inside a Panel. The Panel is where the scroll bar option is set. I used “Auto” in the example, this way the scroll bar will only appear if the amount of rows in the GridView exceeds the height set. The trick lies in placing both controls inside a single ...
Few months ago I've been seeing many users in the forum asking how to generate dynamic textbox on the form and save the values to the database on Button click, so I've decided to write this post and wrap up all the examples that I wrote before on how to accomplish the task using different controls so that when I encounter such or similar questions again in the forum, I can simply refer them to this post. Here are those examples: Using ASP Table: FAQ: Dynamically Adding Rows in ASP Table on Button ...
I've gathered some data into an object and then done a Linq to that object using code a bit like this: //Linq query var q = from c in objFlist.Items orderby c.Surname select c; List<clsFileInfo> listOfItems = q.ToList<clsFileInfo>(); GridView2.DataSource = q; GridView2.DataBind(); That works fine as long as I let the Gridview organise itself from the data automatically. To make it more polished I wanted to lay out the columns in the Gridview and add template columns etc. To do this I ...
Technorati Tags: ASP.NET,C#,GridView Many developers from the forums (forums.asp.net) are asking if how to implement fix header in GridView while scrolling. We all know that there are lots of examples out there that provide a solution that are available, however some of the solutions provided are not cross browser compatible. While searching for a cross browser solution, I found this article at devarchive.net and it seems very interesting to me. So I play around with the extender provided by devarchive ...
Trying to figure out why the page that I am working on is locking up when non-initial loads of the page are called. The page contains 4 bound items: 3 ComboBox controls and 1 SortableListView (custom implimentation of a Listview that contains a Gridview). The page is supposed to allow the user to select one item from each ComboBox, then click "Add" and those items will be added to the SLV. At that point though, two of the three ComboBoxes must be re-loaded and the items that were previously selected ...
Hi this Article is aimed at discussing only the outlines of ASP.NET DataBinding. ASP.NET provides a rich set of controls for working with data.ASP.NET provides the DataBound controls,DataSource Controls to work with data. DataBound Controls : We can use DataBound Controls in our application's to generate the user interface for working with data.The DataBound Controls are used to display the data and modify the data. There are three types of DataBound Controls are available. List Controls Tabular ...
Ever get the idea that someone at Microsoft is just taking the piss? I simply wanted to drag a row from a DataGridView onto a Trash Can picture and delete the row. All the coding had already been done to delete the row so I expected to take 5 minutes knocking up the rest of it. The PictureBox has DragEnter and DragDrop Event handlers so writing that bit was easy: private void picDelete_DragDrop(object sender, DragEventArgs e) { deleteRow(); } private void picDelete_DragEnter(object sender, DragEventArgs ...
Earlier I had written 2 posts – Taking your Northwind Database to SQL Azure and binding it to an ASP.NET GridView Part I and Part II . I thought, I will complete the series with a post on moving your ASP.NET Application as well to Windows Azure making it a truly cloud based application. Before we start, there are a bunch of things that you would need to do. First and foremost, you would need a Token for Windows Azure. You can request for a free token for Windows Azure from here after providing your ...
If you have used the Entity Framework that shipped with Visual Studio 2008 SP1, you would really start appreciating the flexibility it offers for building schema driven data access layer and get it to the UI Layer either directly or using a middle tier such as WCF RIA Service. Check my earlier post on this, if you are interested further :) Meanwhile, the other exciting stuff that has been around is the SQL Azure which is part of the Windows Azure platform. SQL Azure provides relational data over ...
I have been playing with the WCF RIA Services (erstwhile .NET RIA Services) for sometime and found that most of the samples out there focus on Silverlight based applications. While the new WCF RIA Services preview for VS 2010 is awesome in terms of its Silverlight integration, I also wanted to test out on building plain vanilla ASP.NET Applications and using the power of WCF RIA Services to build a middle tier for the same. Ok, to begin with, I already had Visual Studio 2010 Beta 2 installed and ...
With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework. The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to ...
Get a Weak or Strong DataTable Row from a selected DataGridView row. Private Sub btnGetDataGridViewSelectedR... sender As System.Object, ByVal e As System.EventArgs) Handles btnGetDataGridViewSelectedR... '--------------------------... 'Find the first selected row (should only be zero or one since DataGridView1.SelectionMode = FullRowSelect) '--------------------------... ...
DataGridView CSV Editor · Load CSV File into Dataset -> DataGridView · Show cells with Validation Errors with backcolor & tooltip · Right-Click cell to correct cell via tooltip · Restrict KeyPress Keys · Show cell as “edited” via cell backcolor Public Function GetCSVDataTable(ByVal filePath As String) As DataTable ' The dataset to return Dim dt As DataTable = Nothing Try '--------------------------... ' Create "Excel Like" Column Headers '--------------------------... ...
Hello, If you are reading this you probably have already realized that it is not possible to hide a column that was auto-generated using myGridView.Columns[index].V... To achieve this you must: 1 - set the OnRowCreated to execute a function, something like OnRowCreated="gridRowCreated" 2 - Create your function as such: protected void gridRowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[yourIndexHere].... = false; } Hope this helps ;) ...
This example shows how to move multiple rows between GridViews. The main idea here is to use a CheckBox control for selecting the rows to be removed from one GridView to another and vise versa. Take a look at sample screen shots below: On initial load: Selecting rows from the left GridView: After Moving the selected rows to the right GridView: As you notice the selected rows are automatically sorted by its ID upon moving. Selecting rows from the Right GridView: After Moving the selected rows to the ...
Every now and again you may come across an error when trying to update a database from a data driven control (i.e. gridview, formview) that is tied to a SQL or Object data source. The errors usually are along the lines of “Could not find xxx that has parameters” along with a list of those parameters. Or an error that states there are too many parameters being passed. Aside from looking for typos, counting or lining up the parameters I will use one of these techniques to try and narrow down what may ...
If you like to migrate your Web tier or the ASP.NET Application to Windows Azure, check my new posts Part I and Part II In the previous post we had examined on getting access to SQL Azure, creating your first database, accessing it with SQL Server Management Studio and then migrating the Northwind database schema to SQL Azure using the SQL Azure Migration Wizard Beta. UPDATE: The latest version of SQL Azure Migration Wizard migrates both Data and Schema. You can download the same from http://sqlazuremw.codeplex.... ...
If you like to migrate your Web tier or the ASP.NET Application to Windows Azure, check my new posts Part I and Part II SQL Azure is the latest buzz around Cloud Computing and the ability to take relational database to the cloud as is, is something most would welcome compared to the earlier model of ACE (Authority, Container, Entity) that was there when SQL Azure was SSDS. Well, like others, I also got interested and wanted to explore the SQL Azure. SQL Azure is currently in CTP and offers token ...
In this Issue: Jesse Liberty, Jonathan van de Veen, Alex Golesh, Chris Cavanagh, Michael Washington, Danijel Stulic, Bob Bartholomay, Mark Tucker, Chris Klug, and Lee. Shoutouts: Jeff Handley has another poll that he'd like you to take a shot at: Should DomainDataSource.AutoLoad be True or False by default? Walt Ritscher has announced that Shazzam development is moving again... check it out if you haven't already and stay tuned for enhancements! Steve Commisso has been hard at work and has reported ...
It's a shame that the DataGridViewTextBoxColumn class doesn't allow you to set the casing so that you can restrict user input to all upper or lower case letters. Fortunately, it's actually pretty easy to create a custom column class to do just that. public class DataGridViewUpperCaseTextBo... : DataGridViewTextBoxColumn { public DataGridViewUpperCaseTextBo... : base() { CellTemplate = new DataGridViewUpperCaseTextBo... } } public class DataGridViewUpperCaseTextBo... : DataGridViewTextBoxCell ...
When I wrote the first post in this series, there was tremendous amount of interest generated and also a lot of feedback requesting to post some of the advanced features. Like I said earlier, ASP.NET 4.0 has lots of new features some of them as simple as Page.Title whereas so as big as caching improvements. This post covers one such feature which is Routing in Webforms. Although Routing was available even in .NET 3.5 SP1, (check this excellent post by Phil Haack on implementing Routing in ASP.NET ...
Here are some info on how to do an Autoscroll for your program controls TextBox autoscroll textBox1.SelectionStart = textBox1.Text.Length; textBox1.ScrollToCaret(); ListBox autoscroll listBox1.SelectedIndex = listBox1.Items.Count - 1; listBox1.SelectedIndex = -1; ListView autoscroll listView1.EnsureVisible(lis... - 1); TreeView autoscroll treeView1.Nodes[treeView1.N... - 1].EnsureVisible(); DataGridView autoscroll dataGridView1.FirstDisplaye... = dataGridView1.Rows[dataGrid... ...
(this is a repost since the initial post had a few issues that couldn’t be corrected) I am playing with the ASP.NET 4.0 QueryExtender released as a part of the Visual Studio 2010 Beta 1. It provides endless opportunities for working with data without writing much code and when you combine it with a few Ajax features, gives a truly great user experience with very less effort. To begin with you need the Visual Studio 2010 Beta 1 and .NET Framework 4.0 Beta 1. You can install both from http://msdn.microsoft.com/h... ...
In my previous post, I have posted the updated the codes about Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes because there is a bug on that. So obviously the codes in my other example about Adding a Delete functionality in Dynamic TextBoxes in GridView is affected. To fix the issue then you can refer to this updated code below: protected void LinkButton1_Click(object sender, EventArgs e) { LinkButton lb = (LinkButton)sender; GridViewRow gvRow = (GridViewRow) lb.NamingContainer; int ...
Well its seems that there is a little bug with my previous article about “ Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes “. The problem is that whenever you change the value of the previous data in the TextBox the updated values will not reflect on postbacks. So I have modified a bit of my codes at AddNewRowToGrid() and SetPreviousData() methods to fix the issue. Here are the code blocks below for the updates: private void AddNewRowToGrid() { int rowIndex = 0; if (ViewState["CurrentTable"] ...