Welcome Guest Search | Active Topics | Sign In | Register

Check in header to select all rows Options
Vinny
Posted: Monday, July 21, 2008 8:32:17 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Hi,

I have 3 problems that are coming in the way to use this control to its best:

Problem:1

Is there is any way to get a checkbox in the header so that on selecting this checkbox all the items beneath it should get selected?

Problem:2

Is there any way i can set row height dynamically?

Problem:3

Is there a way I can get the export the grid to excel?

Any help will be highly appreciated...

Thanks,

Vinny
eo_support
Posted: Monday, July 21, 2008 8:47:32 PM
Rank: Administration
Groups: Administration

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

As for your questions:

1. Yes. It would require some JavaScript coding. Instead of setting the columns' Header as a simple HTML such as "Header", you would use something like

Code: HTML/ASPX
<input type="checkbox" id="column1_checkbox" onclick="check_rows()"/>


Code: JavaScript
//Check/uncheck all rows
function check_rows()
{
    //Get the grid object
    var grid = eo_GetObject("Grid1");

    //Get whether the checkbox is checked
    var checked = document.getElementById("column1_checkbox").checked;

    //Walk through all grid items
    for (var i = 0; i < grid.getItemCount(); i++)
    {
        var item = grid.getItem(i);
        
        //Modify the second cell of each item. You will
        //need to change this to the desired cell
        item.getCell(1).setValue(checked ? "1" : "0");
    }
}


The above code uses our client side API extensively. So you will want to go over the document if you are not already familar with it:

http://www.essentialobjects.com/ViewDoc.aspx?t=clientapi_howto.html

2. No. You can not set row height dynamically. Our Grid is a fixed row height grid;

3. It's very easy to write some code to export a DataTable to Excel, you can Google "Export DataTable to Excel" and you will find plenty articles. It's completely unrelated to the Grid.

Hope this helps.

Thanks
Vinny
Posted: Monday, July 21, 2008 10:21:02 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Thanks. I was able to fix my first problem and I also able to find "Export". However, I was thinking to have some in-built support for "Export" inside the grid.

Also, I am facing another problem. I tried to increase the Header's height from 24 (default) to 32 because the contents were coming to second line. The Column Header Style is:
<ColumnHeaderStyle CssText="background-image:url('00050202')"></ColumnHeaderStyle>

The problem is that in the remaining 8 pixels (32 -24) the image is not coming. Any suggestions?

Once again thanks for the help. I am really looking forward to use this grid in our projects.

Vinny
eo_support
Posted: Monday, July 21, 2008 10:58:07 PM
Rank: Administration
Groups: Administration

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

You will need to replace the background image with your own image in that case. You can find all the images used by our product in a file called Images.zip in the installation folder. You can create your own image based on any of them and then change the style to use your own images.

Thanks
Vinny
Posted: Monday, July 21, 2008 11:15:49 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Thanks...
Vinny
Posted: Tuesday, July 22, 2008 12:54:26 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
I just got an another problem:

while using <eo:CallbackPanel... I got the following error. Any suggestions...?

"This page contains one or more code rendering blocks (<%=...%>) outside of the form element. This does not work with EO.Web Callback/CallbackPanel control. Please consider moving the code rendering blocks into the form element, or use a server/user control instead. "

Thanks in advance...

Vinny
eo_support
Posted: Tuesday, July 22, 2008 1:06:23 AM
Rank: Administration
Groups: Administration

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

I am not sure what else can be more helpful ----- the error message itself should already be quite clear about what to do.

Thanks
Vinny
Posted: Tuesday, July 22, 2008 5:25:18 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
I know that the message is clear in itself. But, giving a quick look to the code at my end couldn't resolve it. I might have to look again.

Can you help in one another issue?

I have checked this but couldn't find it, I am getting a javascript error like "eo_nm" is undefined. This happened as and when I go to the screen where eo (your grid) is being used. And, after that I cannot move to another link.

Vinny
eo_support
Posted: Tuesday, July 22, 2008 7:18:09 AM
Rank: Administration
Groups: Administration

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

The easiest way to troubleshoot is to try to reproduce the error in a separate blank page. If it doesn't occur there, then it has to do with your page contents. In that case you will try to compare the two pages to locate what triggered the error. If it does occur in a blank page, most likely it's a problem with our product.

In either case you will have a test page that can reproduce the problem. If the problem persists, you can post the test page and we will take a look. When you do that make sure the test page can run. For example, we can't look into a page that relies on your database because we won't be able to run the page.

The same goes for the CallbackPanel error, try to create a test page first, usually you will find out what's wrong during the course.

Thanks
Vinny
Posted: Tuesday, July 22, 2008 7:29:34 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Thanks.. I'll do a test run and let you know about the results.
Vinny
Posted: Tuesday, July 22, 2008 8:34:05 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Hi,

I was able to figure out the "CallbackPanel Error". It the master page was using <%...%> in the <title> tag. I removed that and it start working.

However, I am still struggling with "eo_nm" javascript error. I create a brand new page and just put only the eo grid and still pops up. But, there is a catch. When I am clicking on any button its not raising eo_nm but when I click on any hyperlink then it does so.

Thanks,

Vinny
eo_support
Posted: Tuesday, July 22, 2008 8:48:53 AM
Rank: Administration
Groups: Administration

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

Excellent work! Glad that you sorted out the CallbackPanel error.

As for the Grid, make sure you exclude the master page when you test, that way it will help you narrow down the problem quickly. If the problem continues, post your page source and we will be happy to take a look (again make sure the test page does not rely on anything else so that we will be able to run it).

Thanks
Vinny
Posted: Tuesday, July 22, 2008 10:23:18 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Here is the test page:

TestEO.aspx

<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="TestEO.aspx.vb" Inherits="TestEO" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<form id="Form3" runat=server>

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


<eo:Grid runat="server" id="Grid1" >
<Columns>
<eo:CheckBoxColumn HeaderText="<input type='checkbox' id='column1_checkbox' onclick='check_rows()'/>" Width="30">
</eo:CheckBoxColumn>
</Columns>
</eo:Grid>

</form>

And, I am still getting an error "eo_nm" not defined if I click on the linkbutton.

Thanks,

Vinny
eo_support
Posted: Tuesday, July 22, 2008 10:29:14 AM
Rank: Administration
Groups: Administration

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

Thanks for posting the page. But where did you put the check_rows JavaScript function?

Thanks
Vinny
Posted: Tuesday, July 22, 2008 10:32:41 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
You can remove that function. Just to simplify the code.
eo_support
Posted: Tuesday, July 22, 2008 10:48:41 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
Hi Vinny,

That appears to be a problem. We will try to get it fixed as soon as possible.

Thanks!
Vinny
Posted: Tuesday, July 22, 2008 11:03:37 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Thanks for the response. I am using it in one of the project and this is going to be major thing. I am really looking forward to solution.

Vinny
Vinny
Posted: Tuesday, July 22, 2008 12:31:08 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Hey, I have another problem. I am trying to enter into a loop of checked items by using the following code but no success.

Dim EOItem As EO.Web.GridItem

For Each EOItem In Grid1.CheckedItems

Next

Any suggestions?

Thanks,

Vinny
eo_support
Posted: Tuesday, July 22, 2008 12:44:18 PM
Rank: Administration
Groups: Administration

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

CheckedItems works on the first CheckBoxColumn only. Have you tried using EOItem.Cells.Items(index).Value?

Thanks
Vinny
Posted: Tuesday, July 22, 2008 12:57:13 PM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2008
Posts: 90
Yes, that's the first column in the grid. However, in code-behind its not even giving # of rows in the grid.


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.