Last post Mar 13, 2006 07:54 PM by mharder
Mar 07, 2006 10:51 PM|pradeepy|LINK
I am trying create a webpart by inheriting from webpart class, like
Public Class MyWebPart : WebPart
In the MyWebPart Class i am creating a GridView and adding it to the control collection as follows
If i do so it is throwing an error .
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.
How do i correct this error?? Please correct me if i am going wrong somewhere!!
The reason i am using the syntax this.Page.Form.Controls.Add(grdMyGridView) is if i don't add to Form it is giving an error that GridView should be placed inside a form
I would like to use EnableSortingAndpagingCallbacks feature of GridView.
Any furthur suggestions and comments are welcome.
Mar 10, 2006 10:37 PM|mharder|LINK
Mar 11, 2006 08:36 PM|pradeepy|LINK
MHarder sorry for the late reply. I have done as you have said.
But now it is giving the following error.
The GridView '' fired event Sorting which wasn't handled.
My snippet of code is as below
Does EnableSortingAndPagingCallbacks property in GridView have problems using with webpart??.
When we set EnableSortingAndPagingCallbacks to true do we still need to handle sorting event of the GridView??
I think this is a bug in MicroSoft GridView Control?
Well, Please let me know your comments.
Mar 13, 2006 07:54 PM|mharder|LINK