Error in Design View

Mar 11, 2010 at 10:33 AM
Edited Mar 11, 2010 at 10:33 AM

Hi I have an error in Design View. I am using Visual Studio 2008. I also changed the target framework to 3.5 and rebuilt CoolGridView. The problem is when I drag and drop the component from the toolkit to the page, all I see in the component is a message saying 'There was an error rendering the control. Object reference not set to an instance of an object.' When I run the codes though, the gridview is rendered out okay. But I need to design and edit it in Design View. Any idea why that is? Any idea how to solve it? Thanks. 

Mar 11, 2010 at 6:03 PM

Have you tried registering the control declaratively on the page with an "@ register" tag markup?

 

Mar 11, 2010 at 7:03 PM

Rod --

This is to expand upon my previous post in this thread, please consider the following.

Put this file "IdeaSparx.CoolControls.Web.dll" into the folder "Bin" in your web site.

Then, in the code-infront of the consuming page, use an "@ register" tag, similar to the following...

<%@ page language="C#" autoeventwireup="true" codefile="CoolGridTestPage01.aspx.cs" inherits="CoolGridTestPage01" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ register assembly="IdeaSparx.CoolControls.Web" namespace="IdeaSparx.CoolControls.Web" tagprefix="iscc" %>

<html xmlns="http://www.w3.org/1999/xhtml">

...then in the code-infront, declare the control, similar to the following...

<iscc:coolgridview id="MainGridView" runat="server" autogeneratecolumns="false" allowsorting="True" height="500px" width="950px" allowpaging="false" emptydatatext="NULL" cssclass="IsccGridStyle" pagesize="1000000" enableviewstate="true" allowresizecolumn="false" onsorting="MainGridView_Sorting">

...and that should work.

Does it work for you?

Please advise.

Thank you.

-- Mark Kamoski

Mar 15, 2010 at 10:17 AM

hi mark,

i tried your suggestion but still the component is not rendered in design view. the error is displayed instead of the component during design view. also, i dont think this is a problem of the component being not registered as i tried adding the component to the master page using the same drag and drop from the toolkit and the coolgridview is rendered out okay. but, when i tried adding it to any of my content pages, the component is not rendered during design view, and the error is displayed instead.

any idea? anyone?

thanks.

Mar 15, 2010 at 2:14 PM
rodneycabahug wrote:

hi mark,

i tried your suggestion but still the component is not rendered in design view. the error is displayed instead of the component during design view....

  1. Is the CoolGrid in a Web User Control?
  2. Is the CoolGrid inside any type of container server control, such as asp:panel or asp:table or an Ajax updatepanel or similar?
  3. Is the CoolGrid on a page that uses a MasterPage? A nested MasterPage?
  4. Does my code sample here http://ideasparks.codeplex.com/WorkItem/View.aspx?WorkItemId=5510 load for you and show the control in design view?
Mar 15, 2010 at 2:34 PM

Rod --

FYI, I just did some testing.

I have concluded that if one is using the CoolGrid in a Web User Control, then the design view will change necessarily.

It will show the design-time-error (DTE), something like "There was an error rendering the control" in the web page that hosts the User Control.

It will also show that DTE in the Web User Control.

However, in the Web User Control one CAN still select the control in the design view and set its properties. They will not be rendered but they will be set.

I think this is typical for most controls because I think (but I am just guessing) that full design-time rendering support for all design views has to be built into the control itself and it takes a lot of work so a lot of control developers seem to skip it as it is not completely necessary.

That said, my tests also show that if the CoolGrid is hosted directly on a web page and if it is not in any container control, then it will be both selectable and editable in design-view AND it will be rendered without that DTE.

HTH.

Thank you.

-- Mark Kamoski

 

Coordinator
Mar 15, 2010 at 4:50 PM
Edited Mar 16, 2010 at 2:01 AM

Hi @Rod,

Thank you for reporting this. Integrated and smooth designer support is one of the goals of CoolGridView. I will make sure this is fixed in succeeding build releases.

Hi @Mark,

Thank you for assisting Rod. I greatly appreciate it.

Regards,

John

Mar 26, 2010 at 8:02 AM

hi mark and john,

thanks. sorry, it took so long for me to reply. i had been very busy. i am implementing the changes to our application now, this time, using the coolgridview. i think this will do even without the design view. although, i think it is better, if not best, if design view is also available in all situations. thanks again, especially to john for making this control!

regards,

rodney

Coordinator
Mar 26, 2010 at 4:24 PM

Hi Rod,

Could you send me a sample project that demonstrates this issue.

Thanks in advance.

Regards,
John