Free Download

Site Search

 

Top Download

Showing posts with label code free. Show all posts
Showing posts with label code free. Show all posts

Friday, July 4, 2008

Edit MS Flex Grid in Two Ways

Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

Hi all!

This is my second article on Code Project. This is about how to edit MS Flex Grid. I was using TextBox and ComboBox to edit flex grid at run time, for that I had to add reference of Microsoft.VisualBasic.Compatibility and some complex coding to move TextBox or ComboBox on grid. But this is good idea if some one wants to edit grid with some predefined itemsusing ComboBox.

But if you want to text than there is a simple way to do this; that is the use of Text property of MS Flex Grid Control.

Using the code

To edit MS Flex Grid without using TextBox we have to use .Text property and KeyPressEvent of MS Flex Grid Control.

 
Private Sub AxMSFlexGrid1_KeyPressEvent(ByVal sender As Object, ByVal e As AxMSFlexGridLib.DMSFlexGridEvents_KeyPressEvent) Handles AxMSFlexGrid1.KeyPressEvent

Select Case e.keyAscii

Case 30 To 136

AxMSFlexGrid1.Text += Chr(e.keyAscii)

Case 8

If AxMSFlexGrid1.Text <> "" Then AxMSFlexGrid1.Text = Mid(AxMSFlexGrid1.Text, 1, Len(AxMSFlexGrid1.Text) - 1)

Case 13 And AxMSFlexGrid1.Col <> 2

AxMSFlexGrid1.Col = 2

Case 13 And AxMSFlexGrid1.Col = 2

AxMSFlexGrid1.Rows = AxMSFlexGrid1.Rows + 1

AxMSFlexGrid1.Col = 1

AxMSFlexGrid1.Row = AxMSFlexGrid1.Row + 1

End Select

End Sub

In second techinque I have used a function name moveTextBox to move TextBox at appropriate posiotion and to sent enter text in Grid I have used .Textproperty of Grid control.

 
Private Sub moveTextBox()
TxtEntry.Visible = True
TxtEntry.Left = VB6.TwipsToPixelsX(AxMSFlexGrid2.CellLeft + VB6.TwipsToPixelsX(AxMSFlexGrid2.Left)) + 17
TxtEntry.Top = VB6.TwipsToPixelsY(AxMSFlexGrid2.CellTop + VB6.TwipsToPixelsY(AxMSFlexGrid2.Top)) + AxMSFlexGrid2.Top
TxtEntry.Width = VB6.TwipsToPixelsX(AxMSFlexGrid2.CellWidth)
TxtEntry.Height = VB6.TwipsToPixelsY(AxMSFlexGrid2.CellHeight)
TxtEntry.BringToFront()
TxtEntry.Focus()
End Sub

On TextBox's KeyDown event I have assigned TextBox's .Text property to Flex Grid's .Text property

 
Private Sub TxtEntry_KeyDownEvent(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtEntry.KeyDown
If AxMSFlexGrid2.Col = 1 Then
If e.KeyCode = Keys.Enter Then
AxMSFlexGrid2.Text = TxtEntry.Text
TxtEntry.Clear()
AxMSFlexGrid2.Col = 2
End If
End If
End Sub

On EnterCell event of Grid Control I have called this function.


Private Sub AxMSFlexGrid2_EnterCell(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxMSFlexGrid2.EnterCell
If AxMSFlexGrid2.Col = 2 Then
Call moveCombo()
If AxMSFlexGrid2.get_TextMatrix(AxMSFlexGrid2.Row, 2) <> "" Then
CmbEntry.Text = AxMSFlexGrid2.get_TextMatrix(AxMSFlexGrid2.Row, 2).ToString
Else
CmbEntry.Text = ""
End If
Else
CmbEntry.Visible = False
End If
If AxMSFlexGrid2.Col = 1 Then
Call moveTextBox()
If AxMSFlexGrid2.get_TextMatrix(AxMSFlexGrid2.Row, 1) <> "" Then
TxtEntry.Text = AxMSFlexGrid2.get_TextMatrix(AxMSFlexGrid2.Row, 1).ToString
Else
TxtEntry.Clear()
End If
Else
TxtEntry.Visible = False
End If
End Sub

Thanx And Happy Coding..

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

suresh suthar


Hi All.
I am Suresh Suthar from Mumbai India.
I am a Software Developer working in a private firm as a .NET developer.
I born and brought up in a small village Sewari in Rajasthan.
I started my carrier as a data entry operator in 2006. After that I started learning VB 6.0 and VB.NET 2005.
Now I am developing software using VB.Net 2005
and SQL Server 2000/2005.

Here you will some cool source code and a lots of stuff on
SQL Injection, Code Injection, Encription/Decription, Live project, Tutorials on VBScript,JavaScript,Cold Fusion, C#
and many more...

http://www.programmer2programmer.net/
Occupation: Web Developer
Location: India India


http://www.codeproject.com/KB/grid/EditMSFlexGrid.aspx

Silverlight - General

Title / Updated Author Score
Silverlight 2 Beta 2: The first native rich text editor
Updated: 8 Jun 2008
In contrast to existing ones, my RTE is fully written in C#, and doesn't use any HTML rendering or JavaScript. Most common features are supported!
.NET 3.0, C# 3.0, .NET 3.5, C#, .NET, Dev, XAML, WPF, Design, Intermediate
Christoph Husse 4.87
DeepZoom - Unedited
Updated: 13 May 2008
An article showing how to do DeepZoom in Silverlight 2.0
C# 3.0, .NET 3.5, C#, ASP.NET, .NET, Dev, Design, Intermediate
Sacha Barber 4.81
A simple treeview in Silverlight 2b1 - Unedited
Updated: 14 May 2008
Créating a templatable treeview in silverlight
C#, Advanced
Valentin Billotte 4.74
Legion: Build your own virtual super computer with Silverlight - Unedited
Updated: 29 Dec 2007
Legion is a grid computing framework that uses the Silverlight CLR to execute user definable tasks. It provides grid-wide thread-safe operations for web clients. Client performance metrics, such as bandwidth and processor speed, may be used to tailor jobs. Also includes a WPF Manager application.
C# 3.0, .NET 3.5, VS2008, C#, ASP.NET, .NET, Visual Studio, CEO, Arch, Dev, WCF, XAML, WPF, Advanced
Daniel Vaughan 4.69
Silverlight Alien Sokoban
Updated: 11 Nov 2007
A fun Silverlight implementation of the game Sokoban. Contrasting Silverlight 1.1 and WPF, while showcasing some new features of C# 3.0, Expression Design, Expression Blend, and Visual Studio 2008.
C# 3.0, .NET 3.5, VS2008, ASP.NET, Windows, Dev, XAML, WebForms, Design, Intermediate
Daniel Vaughan 4.67
BackgroundWorker in Silverlight
Updated: 4 Feb 2008
Why not create our own BackgroundWorker for use with Silverlight?
C# 1.0, C# 2.0, C# 3.0, C#, ASP.NET, WinCE, .NET, Dev, WebForms, Intermediate
Valentin Billotte 4.67
CRUD operations in Siverlight using ADO.NET Data Service
Updated: 10 Feb 2008
The simplest way to do CRUD (Create, Retrieve, Update, Delete) operations in Silverlight using ADO.NET Data Service (Astoria).
C# 1.0, C# 2.0, C# 3.0, .NET 3.5, C#, ASP.NET, Windows, .NET, Dev, ADO.NET, WebForms, Ajax, Intermediate
Michael Sync 4.65
Silverlight 1.1 Fun and Games
Updated: 1 Nov 2007
Silverlight 1.1 Fun and Games
.NET 3.5, VS2008, C#, XML, Windows, Dev, Design, Intermediate
Sacha Barber 4.64
SilverStunts - a data driven game in SilverLight - Unedited
Updated: 31 Dec 2007
The article discusses concepts of data driven web games. An example game 'SilverStunts' is presented and described in more technical details.
Win2K, WinXP, Vista, C# 3.0, .NET 3.5, VS2008, C#, Javascript, XML, CSS, Windows, .NET, Visual Studio, HTML, Dev, XHTML, XAML, Intermediate
Antonin Hildebrand 4.60
Creating and Reusing Dynamic Animations in Silverlight - Unedited
Updated: 21 Mar 2008
Create dynamic animations and a simple way to reuse them to reduce xaml code size
C# 2.0, .NET 3.0, C# 3.0, .NET 3.5, VS2008, C#, .NET, Visual Studio, Dev, Beginner, Intermediate
SteveLi-Cellbi 4.60
Silverlight Super TextBox (ComboBox, Masked TextBox and More)
Updated: 31 Mar 2008
Supplementing the Silverlight 2.0b1 Controls
C#, ASP.NET, Dev, Intermediate
Robert Linders 4.57
Networking in Silverlight and WPF or how to make them speak one each other - Unedited
Updated: 22 Apr 2008
How to use raw sockets in Silverlight application and how to make silverlight to speak with windows forms and wpf
IIS 5, IIS 5.1, IIS 6, VS2005, C# 1.0, C# 2.0, C# 3.0, IIS 7, VS2008, C#, VB, ASP, ASP.NET, VBScript, Javascript, XML, Windows, .NET, Win32, Win64, IIS, Visual Studio, HTML, GDI+, Arch, Dev, XAML, WPF, WinForms, XSLT, Ajax, Intermediate
Tamir Khason 4.57
Generate Silverlight 2 DeepZoom image collection from multi-page tiff - Unedited
Updated: 29 Jun 2008
Fast generation of DeepZoom image tile sets, collection thumbnails and xml data in managed code without using external tools
.NET 2.0, C# 2.0, C# 3.0, .NET 3.5, C#, .NET, GDI+, Dev, WinForms, Intermediate
Berend Engelbrecht 4.56
DrawingBrush for Silverlight 2.0
Updated: 12 May 2008
This article is about how to build the missing DrawingBrush object for Silverlight. Also, we'll learn about how to deeply clone Silverlight objects.
C# 1.0, C# 2.0, C# 3.0, C#, Javascript, XML, Windows, .NET, HTML, IE, Dev, XHTML, XAML, WinForms, WebForms, Intermediate
Tamir Khason 4.50
Silverlight Controls - The Path to Reusable XAML
Updated: 23 Dec 2007
An article about Silverlight Controls - The path to reusable XAML
C#, Javascript, XML, Windows, Dev, XAML, Intermediate
Justin-Josef Angel [MVP] 4.45
Silverlight2 Lightbox - Unedited
Updated: 28 Apr 2008
A Silverlight2 lightbox control
C# 3.0, .NET 3.5, VS2008, C#, Javascript, .NET, Visual Studio, Dev, XAML, Design, Intermediate
Tim Mason 4.43
Developing a Custom Control for Silverlight 2.0 - Unedited
Updated: 14 Apr 2008
In this article I show the key steps to develop a Silverlight 2.0 custom control
C# 1.0, C# 2.0, C# 3.0, .NET 3.5, C#, Windows, .NET, Dev, XAML, Design, Beginner
Attila Hajdrik 4.41
Beginning Silverlight 1.1 Part 1
Updated: 12 Oct 2007
Describing basic Silverlight principles
C#, Windows, .NET, Visual Studio, Dev, Beginner
Andrey Baskov 4.41
Clog - Client Logging, Silverlight Edition
Updated: 14 Jan 2008
A customizable log provider system that allows you to harness your existing logging system to log client side messages to your server. Includes a Silverlight interface and Log Viewer.
C# 3.0, .NET 3.5, VS2008, ASP.NET, Windows, Dev, QA, XAML, Design, Intermediate
Daniel Vaughan 4.34
Silverlight Animations in a Practical Business Application - Unedited
Updated: 29 Dec 2007
An article on building a practical business application using Silverlight animations
WinXP, Win2003, Vista, C# 2.0, .NET 3.0, C# 3.0, .NET 3.5, VS2008, C#, .NET, Visual Studio, HTML, CEO, Arch, Dev, XAML, WPF, Design, Intermediate, Advanced
Cal Schrotenboer 4.34
AjaxControlToolkit, Silverlight and JavaScript
Updated: 27 May 2008
An article on combining Silverlight and JavaScript in an ASP.NET Web page
.NET 2.0, C#, ASP.NET, Javascript, Windows, Dev, Intermediate
codegod.de 4.20
SilverLight Introduction
Updated: 26 May 2007
Tinkering with SilverLight to get a 3D scene rendered in the Browser.
VS2005, .NET 3.0, C#, Javascript, Windows, HTML, Arch, Dev, WPF, Intermediate
.Suchit 4.16
Silverlight based AJAX line graph
Updated: 7 Aug 2007
An article on creating real time line graphs for webpages using AJAX and Silverlight.
ASP.NET, Javascript, XML, Windows, .NET, Visual Studio, Dev, XAML, WebForms, Ajax, Design, Intermediate
ashish_patil++ 4.14
Hosting XAML files for Silverlight without registering MIME types on Web Server - Unedited
Updated: 28 Nov 2007
IIS rejects files with unknown type and ISP providers may not have updated their servers with the XAML MIME type. Article suggests a work around to host XAML files.
IIS 6, VS2005, .NET 3.0, IIS 7, .NET 3.5, Windows, Dev, XAML, Intermediate
Sriram Chitturi 4.08
Sierpinski Triangle - An Introduction into Silverlight by Example
Updated: 20 May 2007
An Introduction into Silverlight by Example
WinXP, Vista, IIS 6, VS2005, IE 6.0, C# 2.0, .NET 3.0, IE 7, C# 3.0, IIS 7, ASP.NET, Javascript, HTML, Dev, XAML, WebForms, Design, Beginner
CJCraft.com 4.06
WrapPanel for Silverlight 2.0 - Unedited
Updated: 6 Mar 2008
Simple example of custom panel using Silverlight 2.0
C# 1.0, C# 2.0, .NET 3.0, C# 3.0, .NET 3.5, C#, .NET
lneir 4.05
Meet Microsoft Popfly: Part I - Mashup App Creator Built On Silverlight
Updated: 3 Jun 2007
Learn more about the Mashup creator, Popfly space, and the Web page creator.
.NET 2.0, IIS 6, VS2005, IE 6.0, C# 2.0, IE 7, ASP.NET, Javascript, XML, Windows, HTML, Dev, XAML, WPF, WebForms, Ajax, Design, Beginner
CJCraft.com 4.05
Silverlight 1.1 Hebrew and Arabic Language Support
Updated: 31 Jan 2008
An article presenting Silverlight 1.1 Hebrew and Arabic language support
C#, XML, .NET, Visual Studio, Dev, XAML, Intermediate
Justin-Josef Angel [MVP] 3.94
Silverlight 1.0 Full JavaScript Intellisense
Updated: 21 Dec 2007
An article about Silverlight 1.0 full JavaScript Intellisense
Javascript, XML, Windows, Dev, XAML, Intermediate
Justin-Josef Angel [MVP] 3.81
Developing of silverlight-enabled ASP.NET controls - Unedited
Updated: 4 Jan 2008
This article shows you how to bring revolutionary UI provided by MS Silverlight to the world of ASP.NET control development with the help of recent released ASP.NET 3.5 Extensions CTP
C# 3.0, .NET 3.5, VS2008, C#, ASP.NET, Javascript, .NET, Dev, XAML, Ajax, Design, Advanced
Aleksey Zaharov 3.52
Silverlight 2.0 components development - Unedited
Updated: 24 Apr 2008
This article has been initiated by some knowledge that we wanted to share based on our Silverlight experiences from one of the projects that we made.
.NET 2.0, C# 1.0, C# 2.0, .NET 3.0, C# 3.0, C#, Dev, XAML, WPF, Beginner, Intermediate
Enterra 3.36
Silverlights Out - An Introduction into Silverlight by Example
Updated: 13 May 2007
An Introduction into Silverlight by Example
WinXP, Vista, IIS 6, IE 6.0, C# 2.0, .NET 3.0, IE 7, C# 3.0, IIS 7, ASP.NET, Javascript, CSS, HTML, Dev, XAML, WebForms, Beginner
CJCraft.com 3.19
Drop Down menu in Silverlight 2 - Unedited
Updated: 26 May 2008
Drop Down menu using popup control in Silverlight 2
.NET 3.5, VS2008, C#, .NET, Visual Studio, Dev, Intermediate
RazanPaul 2.77
Silverlight - Save Web Page - Unedited
Updated: 15 Apr 2008
Saving the silverlight based web control to the database.
VS2008, ASP.NET, Visual Studio, XAML
Yildirim Kocdag 2.64
XAML and Silverlight - Unedited
Updated: 6 Apr 2008
What is XAML and its basics
.NET 3.0, C# 3.0, C#, ASP.NET, Javascript, .NET, HTML, Dev, XAML, Ajax, Design, Beginner
Nandini S Anatharam 2.30
How to implement paging in Silver Light2 DataGrid - Unedited
Updated: 26 Apr 2008
How to implement paging in Silver Light2 DataGrid
C# 3.0, C#, ASP.NET
setu_raas 2.00
Html Password Box with Silverlight - Unedited
Updated: 1 Jul 2008
How to communicate from javascript/html page to Silverlight application using password form
VS2008, C#, ASP.NET, Windows, Visual Studio, Dev, WebForms, Beginner, MacOS
Maciej Gren 1.00

Wednesday, October 10, 2007

What is jsProgressBarHandler ?

jsProgressBarHandler is a rewrite of the (unfortunately wrongly named) AJAX Progress / Percentage Bar by Webappers. Improvements made were the change from a set of functions to a true Prototype.js Class, reduction in the number of functions, and making it unobtrusive (if javascript is disabled you'll still see the percentage), amongst some minor tweaks.
jsProgressBarHandler has been tested and verified working in IE6, IE7, FireFox 2 and Safari 3.0.3. Other browsers should work fine too (untested though).

Friday, October 5, 2007

jQuery Treetable



Take a plain html table, wrap the rows you want collapsing/expanding in a tbody with an id of treetable, map each row to it's parent row, set some options, and let jQTreeTable take it from there.
By wrapping it in a tbody, it means you can have other rows within the same table not part of the tree, and it also means that if javascript is disabled, users still get the plain table.
You can set which column takes the treeview effect, and you can also set which parents are collapsed initially. To do this, it must be done with an array, even if there is only one node you want collapsed.
A highlight option can be set so that rows change colour as they are hovered over. There is dynamic striping of the rows, and there is also a custom onselect event which fires on the table cells, that can be handled with a callback function (watch the status bar when you click on a cell). Links within the cells still work as expected.
I took the graphics files from J๖rn Zaefferer's site, and adapted them for my purposes. I hope he doesn't mind.
Sorry I've nowhere to put comments as yet, but I will be keeping a close eye on the jquery-en list, so any feedback/bug finds would be appreciated.
By the way, if you use the script off this page, make sure to remove the part of the script written for this page (just one line). Alternatively, you can download the zipped file here. It includes this php page with it's random treetable generator.

var options = {openImg: "tv-collapsable.gif", shutImg: "tv-expandable.gif", leafImg: "tv-item.gif", lastOpenImg: "tv-collapsable-last.gif", lastShutImg: "tv-expandable-last.gif", lastLeafImg: "tv-item-last.gif", vertLineImg: "vertline.gif", blankImg: "blank.gif", collapse: false, column: 1, striped: true, highlight: true, onselect: function(target){window.status = "You clicked "+target.html();}};
Map Array for the table below is :
[0, 0, 0, 0, 0, 5, 0, 0, 8, 9, 8, 8, 0, 0, 14, 14, 14, 0, 18, 0, 0, 21, 22, 22, 22, 0, 0, 27, 27, 27, 30, 31, 31, 0, 0, 0, 0, 37, 37, 0, 0, 41, 41, 41, 44, 41, 46, 41, 41, 41]


Sample : http://www.hanpau.com/jquery/unobtrusivetreetable.php