Click here to Skip to main content
12,243,333 members (53,058 online)
Click here to Skip to main content

Stats

49.4K views
1.2K downloads
50 bookmarked
Posted

The Grid Processor: Word Processing Abilities for the .NET DataGridView Component

, 7 May 2007
A plugin which offers search and replace, casing and other capabilities for the Microsoft .NET DataGridView component
GridProcessor.chm
DataSetGridProcess.xsc
DataSetGridProcess.xss
DataSet_macro.xsc
DataSet_macro.xss
DataSet_macroGridProcess.xsc
DataSet_macroGridProcess.xss
Forms
GridProcessor.mdb
GridProcessor.suo
GridProcessorDemo
GridProcessor.chm
GridProcessor.mdb
GridProcessorDemo.suo
Properties
Properties
DataSetGridProcess.xsc
DataSetGridProcess.xss
DataSet_macro.xsc
DataSet_macro.xss
DataSet_macroGridProcess.xsc
DataSet_macroGridProcess.xss
GridProcessor.mdb
GridProcessor.suo
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using GridProcessor;


namespace GridProcessorDemo
{
    public partial class Form1 : Form
    {
        private GridProcessor.FormGridProcessor mGridProcessor = null;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            ReadInstructions();
                ReadXmlFile();
        }

        private void button_gridProcessor_Click(object sender, EventArgs e)
        {
            if (mGridProcessor == null)
                mGridProcessor = new GridProcessor.FormGridProcessor(this.dataGridView1);
            mGridProcessor.Show(this);
        }

        void ReadInstructions()
        {
            StreamReader streamReader;
            StringBuilder sbInstructions;
            string textLine;
            string filePath;

            filePath = GridProcessor.Util.GetRootApplicationDirectory();
            if (filePath[filePath.Length - 1] != '\\')
                filePath += "\\";
            filePath += "instructions.txt";

            try
            {
                streamReader = new StreamReader(filePath);
            }
            catch
            {
                MessageBox.Show(this, "Error loading file [instructions.txt]", "GridProcessor Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox1.Text = "instructions should have been ... here :-(";
                return;
            }
            sbInstructions = new StringBuilder();
            while ((textLine = streamReader.ReadLine()) != null)
                sbInstructions.AppendLine(textLine);
            streamReader.Close();
            textBox1.Text = sbInstructions.ToString();
        }

        private void ReadXmlFile()
        {
            string filePath;

            filePath = GridProcessor.Util.GetRootApplicationDirectory();
            if (filePath[filePath.Length - 1] != '\\')
                filePath += "\\";
            filePath += "JazzPianists.xml";

            try
            {
                dataSet_tracks.Tables["Track"].ReadXml(filePath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Error reading XML data file: " + ex.Message, "GridProcessor Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

       }

        private void button_close_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Evan Stein
United Kingdom United Kingdom
I'm a London-based software developer. Originally from New York, I came here in 1997 to run European application development for Standard & Poors. I now work independently ... and I'm still here!

Having seen how US software behaves outside the US, I'm keenly interested in problems of global and multilingual software design. I also used to write intelligence-gathering software, and still can't resist a well-turned algorithm! Before my IT career I was in music, and I'm now combining both interests in a highly-exciting 'Project-X'. I could tell you what it is, but ....

When not thinking about all of the above, I'm fascinated by all aspects of different cultures. (You can't take New York out of the New Yorker.) Interests include jazz, classical and world music, languages, history and ethnic food. I'm also an amateur travel writer and photographer, and run a site at www.travelogues.net, which you're welcome to stop by and visit!

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 7 May 2007
Article Copyright 2007 by Evan Stein
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid