This is a migrated thread and some comments may be shown as answers.

Clicking a row triggers the Cellformatting event to fire.

4 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 May 2009, 02:14 PM
I'm not sure if im using the correct event but let me explain whats happening.

i have a gridview control which display data/images. When a image is changed it fires the cellformating event to play a audio sound, but when i click on the row or cell on the grid it fire the cellformatting event again. Why is this happening?is this by design. I only want to play the audio when the image value changes.

Thanks in advance!

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 May 2009, 09:23 AM
Hi Michael,

The CellFormatting event is fired whenever a cell changes its visible state. Therefore, even when you scroll your grid, this event is fired many times for each cell that becomes visible even for a moment.

Shinu.
0
Nick
Telerik team
answered on 06 May 2009, 11:39 AM
Hello Michael,

Shinu is right, this is not the proper event to implement your scenario. Thank you Shinu for being active community member -- I have updated your Telerik points. 

Since images cannot be changed using the grid directly, you must have some external control and logic for changing them (e.g. a button next to the grid), so you can implement the sound effect there.

You can use the event below to track changes in grid rows:

private void radGridView1_RowsChanged(object sender, Telerik.WinControls.UI.GridViewCollectionChangedEventArgs e) 
    if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.ItemChanged) 
    {    
                 
    } 

Do not hesitate to write me back if you have further questions.

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michael
Top achievements
Rank 1
answered on 08 May 2009, 02:02 PM
Ok...I'm using the Rowschanged event but its not firing at all! The data has changed in the row and it should fire everytime data changes. Also by using this event i need to find out what column and data value triggered the change.
0
Nick
Telerik team
answered on 11 May 2009, 08:45 AM
Hi Michael,

Well you cannot tell which column(cell respectively) was changed. You can only get information about which rows have been changed, but you have to change the picture in code so you probably know that information. Please send us some code so we can help you further with that.

Best wishes,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Nick
Telerik team
Michael
Top achievements
Rank 1
Share this question
or