"Code, Beer and Music ~ my way of being a programmer"
Few days ago, a developer posts a comment in my previous article about “Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes” asking if how to implement the same functionality with DropDownList. In this example, I will going to show on how to generate a Row in GridView with DropDownList when clicking a Button that is residing inside a GridView Footer and retain the Selected Items of the DropDownList on postbacks. Here are the code blocks below: ASPX Source: <html xmlns="http://www.w3.org/19... ......
I decided to write this simple example because I always encounter this kind of issue at the asp.net forums including this thread: http://forums.asp.net/t/144... Basically this demo shows on how to generate rows of TextBoxes in ASP Table on every click of the Button and retain the entered values on postbacks. Here are the code blocks below: ASPX: <html xmlns="http://www.w3.org/19... <head runat="server"> <title>Dynamic Adding of Rows in ASP Table Demo</title> ......
I decided to write this example because I always encounter this type of questions at the asp.net WebParts and Personalization forums. Many of us have used UserControls as WebParts so that we can incorporate different server controls in a single WebPart element and there are times we need to retrieve or pass a value to a Control that‘s inside a UserControl. So in this example, I will show different ways on how to get or pass values to a control that is residing within a UserControl. Suppose that we ......
I decided to write this example because this has been asked many times before at the forums. As you may know, we cannot "directly" hide AutoGenerateColumns in our codes using the code below: GridView1.Columns[index].Vi... = false; Why? This is because auto generated columns are not added in the GridView columns collection.Using the code above will give you "index was out of range error". In this example I will show the different ways on how to hide specific column in GridView with AutoGenerateColumns ......
Few days ago, one of the members at asp.net forums ask if how to display the data that comes from the DataTable to a Table, so I decided to post the solution that I have provided there as a reference to others. In this example I’m going to create a DataTable by hand and define the columns and row values manually and then display data to the Table. Here are the code blocks below: private DataTable CreateDataTable() { DataTable dt = new DataTable(); DataRow dr = null; //Create the Columns Definition ......
This example demonstrates on how to move items between two ListBox using JavaScript. Here are the code blocks below: <html xmlns="http://www.w3.org/19... <head runat="server"> <title>ListBox Demo</title> <script type="text/javascript" language="javascript"> function AddItemInList(fromLeftToRight, isAll) { var list1 = document.getElementById('&l... ListBox1.ClientID %>'); var list2 = document.getElementById('&l... ListBox2.ClientID %>'); if(Boolean(fromLeftToRight) ......
This example shows on how to get all server controls ID in the page using recursive FindControl. Here are the code blocks below: protected void Page_Load(object sender, EventArgs e) { GetPageControlsID(Page); } public void GetPageControlsID(Control Parent) { string txBoxID = string.Empty; string ddListID = string.Empty; string lblID = string.Empty; System.Collections.Speciali... strColTxtBoxID = new System.Collections.Speciali... System.Collections.Speciali... ......
There are times that we need to use the enter key instead of using the Tab key for moving the focus of the TextBox controls from one to another to perform rapid data entry in the page. This example shows on how to achieve that with the use of JavaScript. Here are the code blocks below: ASPX: <html xmlns="http://www.w3.org/19... > <head id="Head1" runat="server"> <title>Demo</title... </head> <script type="text/javascript" language="javascript"> function controlEnter ......
I decided to write this simple demo because this issue has been asked many times at the forums. Hidden columns are fields in GridView that you don’t want to expose or show in the page, usually this field is the primary key of the data. Since a primary is a confidential data then you might want to hide it to the users. Most people usually use BoundField columns for displaying the data and just hide the field that contains the primary key. In this example, I will demonstrate two ways on how to access ......
Just published few articles at ASP Snippets site. try to check the site and I'm sure you will find lots of useful articles there about ASP.NET... Good Luck! Technorati Tags: General ......
This example is a continuation of my previous post about “Adding Rows in GridView”. In this example I will going to demonstrate on how we are going to do Edit, Update and Delete operations in GridView using TemplateField Columns. If you wan’t to implement those operations using BoundField Columns then you can refer to my previous example about “GridView: Insert, Edit, Update and Delete – the ADO.NET way”. Since this example is a continuation, then I would recommend you to start reading this example ......
This example shows on how to add rows of data in the GridView control. In this example, I created a simple database table called “Table1” for storing the data. The Table has the following columns: Id – PK Employees Position Team Note that I added some dummy data in table that I have created so that we can display something in the GridView when the page is loaded for the first time. To get started, let’s grab a GridView Control from the Visual Studio ToolBox and place it in the webform. Then set up ......
This demo shows on how to create an "Editable" Label in the page. As we all know, a Label control is intended for displaying read-only data information in the page and thus we cannot make it editable just like the TextBox control. As a workaround we can create a floating Div/Panel with a TextBox. Clicking on the Label will display a Div with a TextBox on it and a Button for updating the Text in the Label. In this demo, i used JavaScript for manipulating the elements in the page and apply a little ......
Introduction: I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside the GridView footer. To get started, let’s grab a GridView control from the Visual Studio Toolbox and put it in the WebForm. The mark up would look something like this: <asp:gridview ID="Gridview1" runat="server" ShowFooter="true" AutoGenerateColumns="false"... ......
There are certain scenarios that we need to combine an AutoGenerated Columns with TemplateField Columns or even BoundField Columns in the GridView. As we all know, by default the GridView will automatically display all the AutoGenerated Columns to the rightmost column of the GridView. Consider this example below: Assuming that we have this GridView markup below: <asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Button ID="Button1" ......
The following are the Lists of WYSIWYG Editor that you can pick: RadEditor (Telerik). AJAX-enabled. WebHtmlEditor (Infragistics). Cute Editor (CuteSoft) FreeTextBox (FreeTextBox.com). Free for basic edition. Source code available (for a price). Peter's Textboxes (Peter Blum). Suite of enhanced text box controls. UltimateEditor (Karamasoft) Asbru Web Content Editor (Asbru) ASP.Net XHTML WYSIWYG Editor (MoreNet) AspLib Component library (Astron Digital). Includes a WYSIWYG editor, among other things. ......
I decided to post this because this has been asked many times before at the forums. So for those who doesn't know how to generate a control event that are residing within the TempleFields of GridView then you can follow these few steps below: * Switch to Design View in Visual Studio Designer * Right Click on the GridView * Select Edit Template and then Select the Column where the Control that you wan't to generate the event resides (e.g Button, TextBox, etc..) * The GridView will then changed to ......
When I visit CodeASP.Net I found out that two of my articles there was included at the "Featured Articles" section in their home page. This has been a really great experience to me.. I will try to continue writing some other useful articles soon... Technorati Tags: Community ......
I decided to post this because I wan't to share this information that I have gathered during my investation about ASPNET WebParts last 2007. Maybe this will be useful for those who are using ASPNET WebParts in ASPNET 2.0. Basically this information shows the difference between the Standard WebParts that shipped in ASP.NET 2.0, ASPNET Futures and My Custom WebPart with Custom Verbs. Main OBJECTIVES: * Allows cross browser drag and drop capability (can be moved between WebZones) * Ajax enabled Findings ......
Recently I have encountered a question at the aspnet forums asking if how to select only one RadioButton vertically and horizontally in a Table.( see this thread). As you can see from that thread, the first solution that I was provided was to use a RadioButtonList Control because it allows you to set the RepeatColumns, RepeatDirection and RepeatLayout attributes. But unfortunately that doesn't actually meets the requirement of the Original Poster (OP). Basically the OP wanted to Select only one RadioButton ......
I decided to write a simple demo about this because I always encounter this issue at the forums. Basically, this demo shows how to pre select multiple list items in the ListBox control based from database value. Assuming that we have this table definition with data below: As you can see, the Table has a "IsSelected" boolean field which indicates that a particular employee name is selected or not. Note that in this demo, I named the Table above as "Table1". Now lets set up our ListBox at the ASPX ......
I decided to write this post because I always encounter this kind of issue so many times before at the forums. The main question is that they want to automatically calculate the totals when a user enter an amount from the TextBox control that is residing in the GridView template. So this example shows the basic way on how to achieve this with the server side manipulations. Note that this demo requires that you know the basics of ADO.NET and for binding a GridView control with data from database. ......