We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PrepareViewStyleInfo Event - DataBoundGrid

Clay, I have sitution where I need to callt below event. I tried calling using the below code but no luck. this.gridDataBoundGrid1.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(grid_PrepareViewStyleInfo); I would like to change the background color of the row. User will click on some cell, then we open the dialogbox to enter some row number. Once we return back to the calling problem that particular row background color should be changed! Thanks Satish

3 Replies

AD Administrator Syncfusion Team July 26, 2004 09:22 AM UTC

You do not call PrepareViewStyleInfo. Instead, you tell the grid to repaint itself, and during this process, the PrepareViewStyleInfo event is raised. So, in your button handler, you might include code like, grid.Focus(); grid.RefreshRange(GridRangeInfo.Row(someRowIndex)); to have the grid redraw the row whose index is someRowIndex.


SA Satish July 27, 2004 04:17 AM UTC

Clay, Thanks a lot. Please find the attachment. In this file I would like to make whole (selected) row background color change not a single column. How to achieve this. Thanks, Satish >You do not call PrepareViewStyleInfo. Instead, you tell the grid to repaint itself, and during this process, the PrepareViewStyleInfo event is raised. > >So, in your button handler, you might include code like, > >grid.Focus(); >grid.RefreshRange(GridRangeInfo.Row(someRowIndex)); > >to have the grid redraw the row whose index is someRowIndex. DisableCol2_9544.zip


AD Administrator Syncfusion Team July 27, 2004 05:27 AM UTC

Comment out this line in your PrepareViewStyleInfo so the coloring code is hit for every column, not just the perJobColIndex column. //if (e.ColIndex == perJobColIndex)

Loader.
Live Chat Icon For mobile
Up arrow icon