Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > ASP.NET 4.5 General Discussion
|
ASP.NET 4.5 General Discussion For ASP.NET 4.5 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4.5 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 15th, 2013, 12:02 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default Use RowDataBound event from custom class (non-code behind) module

I've got an existing Gridview, GLGV, works fine, with a complex custom built row structure. In the page code behind, the GLGV_RowDataBound routine calls a couple of non-code behind class functions that do all the work.

In another part of this story, I use callback technology in lots of ways, including for context-specific popup menus, and for building and inserting "in table" GLGV add rows. The callback tells the server code to create a control, render the control, and send back the string, which the client javascript then inserts into the appropriate <div> or Gridview <td>. I've even implemented this cycle for a highly complex diagram with several dozen elements. Again, all works fine.

Now I'm going to convert the entire GLGV gridview to do the same type of callback refresh. Just to be clear, Update Panels will not be part of this solution.

I've wired up a test cycle in which this happens:

client JS - send callback to initiate GLGV refresh
page codebehind - route callback request to custom class (non-codebehind module) for processing
custom class -
- instantiate the page in a local variable,
- find GLGV on the page, put it into a local variable = wrkGLGV as GridView
- databind wrkGLGV
- render wrkGLGV to string
- set up the render string for sending back to the client in the callback return
client JS - take the received callback string of the rendered GLGV and put it in the appropriate <div>

All works fine, except: the rendered wrkGLGV string consists of only "<div></div>". And, the page codebehind GLGV_RowDataBound event is not triggered during the custom class wrkGLGV.databind (which does happen just fine on postback).

I don't understand how the databind in the custom class relates to the page codebehind, however, I can imagine that there's some background wiring which just isn't evoked when the control databind occurs in a custom class, even if it is the "same" control.

So, I'm looking for help in understanding one or more of:
1) how to evoke the GLGV_RowDataBound event that's in the page codebehind,
2) how to create the same effect as calling the GLGV_RowDataBound event, but do it all in the custom class
> Is there some "RowDataBound" event that can be associated with my "wrkGLGV.databind" instruction in the custom class?
3) do I have to move the callback processing for this type of GridView refresh (there will be 3 more of these) back into the codebehind?
4) something else to get the effect I want

My preference would be to NOT do 3).

Any help with this would be appreciated.

Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass value between class module? yvon Pro VB 6 1 November 23rd, 2005 12:58 PM
creating an event for a custom class? lkubler BOOK: Beginning Access 2003 VBA 3 September 20th, 2005 03:47 PM
Class module variables in VB6 maxpotters Pro VB 6 2 September 18th, 2005 12:15 PM
Missing code in the FormChanger class module jkuusik BOOK: Excel 2003 VBA Programmer's Reference 0 April 20th, 2005 08:55 AM
CFormChanger Class module maccas Excel VBA 0 September 28th, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.