Coder Social home page Coder Social logo

digitalcolony / asp-net-gridview-highlight-rows-columns Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 7 KB

Adding row and column highlighting to an ASP.NET Gridview.

CSS 1.34% C# 6.63% JavaScript 92.03%
highlighting gridview-control asp-net tabular-data css javascript

asp-net-gridview-highlight-rows-columns's Introduction

Gridview Highlight Rows (ASP.NET)

I put this code together around 2005 or so to add row and column highlighting to a Gridview control for ASP.NET 2.0.

This code is inspired by Ryan Scherf’s Table Row and Column Highlighting. It’s a slick solution to helping users read tabular data. I thought it would be nice to add that functionality to ASP.NET. So I created a single function that would add Ryan’s column and row highlighting code to our GridView control.

Ryan's Demo

Files Needed

On Ryan’s demo site, you can find the crosshair javascript file (aka CSS/JavaScript Table Hilighting). You will also need a crosshair CSS file.

crosshair.css

Place this file either in your App_Theme folder (if you are using themes), embed it in the head of the document or link to it externally.

AddCrossHairToGridView.cs

After loading your GridView, make a call to the AddCrossHairToGridView function. It takes 5 parameters.

  1. gv - The ID of the GridView Control you wish to add highlighting to.

  2. top - How many rows from the top should not have highlighting.

  3. right - How many rows from the right should not have highlighting.

  4. bottom - How many rows from the bottom should not have highlighting.

  5. left - How many rows from the left should not have highlighting.

I dropped the Javascript file inside the same folder in this example. Update the path in the RegisterClientScriptInclude line to point to whatever location you use.

Row highlight

asp-net-gridview-highlight-rows-columns's People

Contributors

digitalcolony avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.