Mouseover, mouseout, click etc on datagrid.

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Mouseover, mouseout, click etc on datagrid.

    Hi there,
    Does anyone know of a way that I can specify javascript functions that
    are to be run when a cell is clicked, mouse over etc in a datagrid
    without attaching the function to every single cell?

    I have a diary view with resources across the top and times down the X
    axis which means it contains hundreds of cells. I want to add some nice
    javascipt that makes the cells change colour as the mouse moves over
    them etc. I can get it to work fine by putting a function call behind
    each cell (added during the itemdatabound event) but it makes for a
    very big download and a lot of processing at data itemdatabound time.
    Can I specify that if any TD is clicked I want to run a function?
    Any help would be much appreciated,
    Thanks
    Johnny

    johnnydublin@gmail.com Guest

  2. Similar Questions and Discussions

    1. image on mouseover close on mouseout
      Howdy, I have an imagemap with 4 sections. I want to mouseover and show that image and close it on mouseout. The openbrowser window behavior is...
    2. DataGrid EditItemCommand : must click twice to make DataGrid Editable
      Hey- I am having trouble with a simple datagrid example, and need some advice if anyone is knowledgable. It's really driving me batty! I've...
    3. datagrid: show movie clip on mouseover row
      I'm currently working with a datagrid. Basically, I want to show a movieclip above the cursor when someone mouseovers a row. The movie clip will...
    4. whole Row in datagrid is sensitive on click
      Hi, (C#, ASP.NET) I need to invoke server procedure when user click anywhere on data row in datagrid (datagrid has 6 columns). I need also know...
    5. Image: MouseOver - MouseOut - OnClick problem
      Imagine this: I have a gif-image with text, coloured green. When MouseOver occurs the gif will swap to another gif with red colourded text. On...
  3. #2

    Default Re: Mouseover, mouseout, click etc on datagrid.

    Hi Johnny,

    Handle the ItemDataBound event for the datagrid. In each of the rows of type
    Item or AlternateItem, look for the cell you want.
    Perform an .Attributes.Add() for the cell, and in this method you can
    specify the javascript function you want to call. For example (I'm typing
    this off my head, I don't have the IDE open)

    e.Item(4).Cells(0).Attributes.Add("onMouseOver","m yColoringFunction();")

    HTH
    Altaf


    --------------------------------------------------------------------------------
    All that glitters has a high refractive index.
    [url]www.mendhak.com[/url]


    <johnnydublin@gmail.com> wrote in message
    news:1132915855.600892.50150@f14g2000cwb.googlegro ups.com...
    > Hi there,
    > Does anyone know of a way that I can specify javascript functions that
    > are to be run when a cell is clicked, mouse over etc in a datagrid
    > without attaching the function to every single cell?
    >
    > I have a diary view with resources across the top and times down the X
    > axis which means it contains hundreds of cells. I want to add some nice
    > javascipt that makes the cells change colour as the mouse moves over
    > them etc. I can get it to work fine by putting a function call behind
    > each cell (added during the itemdatabound event) but it makes for a
    > very big download and a lot of processing at data itemdatabound time.
    > Can I specify that if any TD is clicked I want to run a function?
    > Any help would be much appreciated,
    > Thanks
    > Johnny
    >

    S.M. Altaf [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139