Welcome Guest Search | Active Topics | Sign In | Register

Callback not working Options
Vinny
Posted: Tuesday, July 22, 2008 2:00:42 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90

TestEO.ASPX

<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="TestEO.aspx.vb" Inherits="TestEO" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<form id="Form3" runat=server>

<asp:LinkButton ID="ImgTitleSearchl" CausesValidation="False" runat="server">Title</asp:LinkButton>

<eo:CallbackPanel runat="server" id="CallbackPanel1"
Triggers="{ControlID:Grid1;Parameter:},{ControlID:tstbtn;Parameter:}" Width="100%"
LoadingHTML="Processing data, this may take a while..."
AutoDisableContents="True">

<eo:Grid runat="server" id="Grid1" >

<Columns>

<eo:CheckBoxColumn HeaderText="<input type='checkbox' id='column1_checkbox'/>" Width="30"></eo:CheckBoxColumn>

<eo:TextBoxColumn AllowResize="True" AllowSort="True" HeaderText="Notes" Width="190" DataField="NAME"></eo:TextBoxColumn>

</Columns>

</eo:Grid>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

<asp:Button ID="tstbtn" runat="server" />
</eo:CallbackPanel>



</form>
</html>

TestEO.ASPX.VB


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Filldatagridonload()
End If
End Sub

Private Sub Filldatagridonload()
ds = da.getDataset("SQL QUERY")
Grid1.DataSource = ds
Grid1.DataBind()
End Sub


Problem:

1. Even if there is no event of "tstbtn" when I click it the grid goes blank (Header exists but no data)
2. sometimes the browser shows a message that "Grid requires a license" when this appears then the grid with header goes blank.

I really don't if I am missing anything here.

Vinny
eo_support
Posted: Tuesday, July 22, 2008 2:36:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

You need to either give the CallbackPanel or the Grid a pixel height value (100% height doesn't work on the form because the form's is not a block element, thus browser often regards it's height as 0). It's not that the Grid loses its data, it's the Grid couldn't figure out the height so it doesn't know how to display the data.

The license message is normal. You do need to purchase a license to remove this message permanently.

We have posted a new build that fixed the other error that you reported. Please check your private message for download location.

Thanks
Vinny
Posted: Tuesday, July 22, 2008 2:44:23 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
I have given the height to both of them. Sorry about not writing here. Still it doesn't work.
eo_support
Posted: Tuesday, July 22, 2008 2:57:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

We verified the following code works fine:

<form id="Form1" method="post" runat="server">
<asp:LinkButton ID="ImgTitleSearchl" CausesValidation="False" runat="server">Title</asp:LinkButton>
<asp:Button id="tstbtn" runat="server"></asp:Button>
<eo:CallbackPanel runat="server" id="CallbackPanel1" Triggers="{ControlID:Grid1;Parameter:},{ControlID:tstbtn;Parameter:}"
Width="100%" LoadingHTML="Processing data, this may take a while..." AutoDisableContents="True" Height="300px">
<eo:Grid id="Grid1" runat="server" Width="100%" Height="100%">
<Columns>
<eo:CheckBoxColumn HeaderText="<input type='checkbox' id='column1_checkbox'/>" Width="30"></eo:CheckBoxColumn>
<eo:TextBoxColumn AllowResize="True" AllowSort="True" HeaderText="Notes" Width="190" DataField="NAME"></eo:TextBoxColumn>
</Columns>
</eo:Grid>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</eo:CallbackPanel>
</form>

Changes we made:

1. Added a fixed height to the CallbackPanel;
2. Added percentage width and height to the Grid (you can also use fixed height);
3. Moved the button to the top so that it's easier to click;

Our code behind is as follow:

Code: C#
private void Page_Load(object sender, System.EventArgs e)
{
    if (!Page.IsPostBack)
    {
        Grid1.DataSource = new object[]{this};
        Grid1.DataBind();
    }
}

public string NAME
{
    get
    {
        return "Test";
    }
}


Instead of populating from a database, we populate from an array of object. The array contains only one item which is the page itself. We then define a property "NAME" on the page, which is somewhat similar to a field on a table record.

Please try the above code and see if it works for you.

Thanks
Vinny
Posted: Tuesday, July 22, 2008 3:40:33 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Thanks. It's working....
eo_support
Posted: Tuesday, July 22, 2008 3:48:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Excellent. Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.