User Profile & Activity

Handy Surya Support
Page
of 223

Hello David,

Please ensure that you have ISNet.WebUI.WebDesktop.Resources.dll in your project bin folder. This error occurs because the context menu needs the assembly to load the resources.

Regards,
Handy

Hello Eric,

Ok, I will try to help you but as far I run your sample, it does not reflect some of your statement.

The current setting of the dropdown must change the captions of the columns in both grids. In my original sample this was implemented, but I think the captions were set in a way that it didn't really change. So you probably overlooked this. I'm trying to add this to your changed code, but I'm not sure how to do so. Right now my code doesn't work this way.

Unfortunately, I don't see 'set caption' is working in your sample. I knew that you set 'set caption' in your code, but it just does not reflect when running the sample.

Perhaps, you can show me if I am missing or mistaken this point. With this way, I can know which part should I modify the sample.

In reality changing the dropdown and pressing Refresh takes a minute or so (to get the data). That's why we implemented the Refresh button. But if the user changes the dropdown and forgets to press the Refresh button, the current screen reflects data that is not true; the values in the grid don't match the dropdown selection. That's why in my sample I set the grids to invisible and only the Refresh button sets them back to visible due to a refresh. I'll try to implement this also again into your sample.

Ok, you can let me know the progress. In my modified sample, I already compared with your sample.
I tried to load the same data and not sure which data that not true. 
Did you mean this only in other scenario?

Also the functionality that if no data is in the grid, then all columns should be set to invisible except the first column. The first column should be extended to fill the whole screen (lets say fixed 500px). As soon as the grid is refreshed with data, the missing columns should get visible again and the size of the first column readjusted to it's default size.

Well, same as my previous comment. Even though you said that some columns should be set to invisible where is no data available, unfortunately , this is also not reflected in your sample.
My modified sample only follows how your current sample work. If I am missing or mistaken in some parts, please let me know. I will gladly to help you.

Regards,
Handy  

Posted: January 6, 2011 9:35 PM

Hello Nick,

I made a simple test but all of them work as expected. When refresh one WebGrid, the other would not get refreshed as well.
Would you mind to check or modify my sample so it can replicate your issue?
When refresh a WebGrid, IntializeDataSource server side event should be called. In my sample, only one WebGrid IntializeDataSource is called. 

Regards,
Handy

Hello Eric,

I understand. I tried to follow the logic and behaviour of this sample, but still unable to find the proper way due to the complex scenario.
However, I recreate the page and use a different way for this sample.
I create the sample without UpdatePanel or FullPostBack at all. Please try to run my sample. It is using all FlyPostBack request. The response is faster. All of the codes are also placed in correct event.
Please let me know if you like this approach or not. Any feedback regarding this approach are welcome.

Regarding the slider issue, I succeed to find what caused this issue. I will report this to our developer teams.

Regards,
Handy

Hello Tim,

Ok, I understand about your explanation.
However, I think it would be very difficult to query this recurring event in your scenario.
To create a recurring event, there are much options such as Daily, Weekly, Monthly, Yearly. Each of them have their own options and also the range options.

In range options there are also No End Date, End After X occurences, and End By.

If user choose After X occurences, you could not query based on EndDate because EndDate is always null.
If user choose End By, you can query based on EndDate, but you also need to calculate the the other options.
e.g Reccurence pattern "Daily". It has two options such as Every X days and Every week days.

If user choose Every X days, maybe you would not difficult to calculate it.
But if user choose every week days, you also need to reduce the calculation with not week days.

Regards,
Handy

Hello Eric,

Ok, I understand your point now. Unfortunately, this is also not a bug. This is caused by incorrect logic of the codes. 
Previously, you have incorrect logic by putting the code in  unproper event.
That's why I changed it into another approach. However, I did not estimate the other validation during my evaluation of this scenario. I only intend to resolve the script error. 
Previously, the width was working well because it follows the column resize dynamically.
After I moved the code, it won't follow the column resize dynamically, because the width itself got set again into 80px. Every postback, would set the width into 80px again in preparedatabinding.
So, you would also need to find the other approach to define the width.

Btw, I found a missing logic in this sample. When bound data into the WebGrid, do sorting. All data/rows would be discarded. It is because dropdownlist value is always "ND".
To resolve this issue, you will need to set "PostInputControls" properties in FlyPostBackSettings properties.

So, basically in complex scenario, sometimes the issue is occured because incorrect logic or validation. 
But for the slider issue, I also suspect this as a bug. I need your help to replicate this issue in more simple sample.

Regards,
Handy

Hello Mark,

Our developer has added new logic to SetReadOnly method. While it is being fixed, you can apply below snippet code for your scenario. In the next release, you can ignore the code.

        function setWI_valueTest(controlID)
        {
            var el = ISGetObject(controlID);
            var txt = document.getElementById('txt1');
            if (txt)
            {
                var newDT = new Date(txt.value);
                if (newDT)
                {
                    if (el)
                    {
                        WI_setReadOnly(controlID, false); // set to read only
                        el.SetValueData(newDT, true);
                        el.SetReadOnly(true);
                        el.EditFormat.ReadOnly = true;
                        el.GetControlElement().removeAttribute("readOnly");
                    }
                }
            }
        }
        function getWI_value(controlID)
        {
            var IS_WI = ISGetObject(controlID);
            if (IS_WI)
            {
                return IS_WI.GetValueData();
            }
        }
        function WI_setReadOnly(controlId, readOnly)
        {
            var IS_WI = ISGetObject(controlId);
            if (IS_WI)
            {
                IS_WI.SetReadOnly(readOnly);
                IS_WI.GetControlElement().setAttribute("readOnly", "readonly");
                return true;
            }
        }
        function setDT(controlID, isReadOnly)
        {
            setFocusISWebInput(controlID)
            WI_setReadOnly(controlID, true); //false is passed; make it writable
            return true;
        }
        function setFocusISWebInput(controlID)
        {
            var WI = ISGetObject(controlID);
            if (WI)
            {
                WI.SetFocus();
                return true;
            }
        }
        function WI_OnAfterValueChanged(controlId, newValue, newText)
        {
            alert('value changed!')
        }
        function setWI_Date(controlId)
        {
            setWI_valueTest(controlId)
        }

 


Regards,
Handy

Posted: January 4, 2011 10:14 PM

Hello George,

Please look into our sample, CustomEditor_WebTextEditor.aspx. Notice that, it also allows multiline.
You were missing to add MaxHeight properties for the cell.

e.g Please see my page structure below.

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="TextEditorWithMultilineWebGridColumn.aspx.vb"
    Inherits="TextEditorWithMultilineWebGridColumn" %>
<%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %>
<%@ Register Assembly="ISNet.WebUI.WebTextEditor" Namespace="ISNet.WebUI.WebTextEditor"
    TagPrefix="ISWebTextEditor" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head runat="server">
    <title>Untitled Page</title>
</head>
<body id="body" runat="server" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
    <form id="form1" runat="server">
    <div>
        <ISWebGrid:WebGrid ID="WebGrid1" runat="server" DataSourceID="AccessDataSource1"
            Height="328px" UseDefaultStyle="True" Width="778px">
            <LayoutSettings AllowEdit="Yes" RowHeightDefault="-1px">
            </LayoutSettings>
            <RootTable DataKeyField="EmployeeID">
                <Columns>
                    <ISWebGrid:WebGridColumn Caption="EmployeeID" DataMember="EmployeeID" DataType="System.Int32"
                        Name="EmployeeID" Width="100px">
                    </ISWebGrid:WebGridColumn>
                    <ISWebGrid:WebGridColumn Caption="LastName" DataMember="LastName" Name="LastName"
                        Width="100px">
                    </ISWebGrid:WebGridColumn>
                    <ISWebGrid:WebGridColumn Caption="Notes" AllowMultiLine="true" DataMember="Notes"
                        Name="Notes" CustomEditorName="WebTextEditor" MaxHeight="200px" CustomEditorServerId="wte1"
                        EditType="Custom" Width="100px">
                    </ISWebGrid:WebGridColumn>
                </Columns>
            </RootTable>
        </ISWebGrid:WebGrid>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Northwind.mdb"
            SelectCommand="SELECT [EmployeeID], [LastName], [Notes] FROM [Employees]"></asp:AccessDataSource>
    </div>
    <ISWebTextEditor:WebTextEditor ID="wte1" runat="server" AllowResize="Yes" Height="300px"
        Width="500px" DefaultStyleMode="ElegantBlackStyle" MinimumSize="300, 200">
        <RootTextEditor>
        </RootTextEditor>
        <ToolBarSettings ToolBarMode="Minimal" />
        <ViewSettings EnableSplitView="false" />
    </ISWebTextEditor:WebTextEditor>
    </form>
</body>
</html>

Regards,
Handy

Hello Jean,

Sure, please use the following codes below.

   function WebScheduler1_OnInitialize(controlId) {
            var s = ISGetObject(controlId);
            var table = s.GetResourcesTable();
            var rows = table.rows;
            for (var i = 1; i < rows.length; i++) {
                var cell = rows[i].cells[1];
                var div = cell.children[0].children[0];
                var resources = s.Resources;
                var resourceIndex = i - 1;
                if (resourceIndex < resources.length) {
                    var str = "<img id='detail" + resources[resourceIndex].ResourceID + "' src='./images/detail.gif' type='detail' style='margin-left: 5px; cursor: pointer;' title='Click here to show detail'>"
                    var temp = document.createElement("DIV");
                    temp.innerHTML = str;
                    div.appendChild(temp.children[0]);
                }
            }
            Listener.Add(table, "onclick", DetailClick);
        }

Regards,
Handy

Hello Tim,

I think you would not need to calculate the start time and end time. You can use TotalRecurrence to have the total hour.

e.g

SELECT r.ID, r.ResourceName,re.Subject,  re.StartTime, re.EndTime,ri.TotalRecurrences ,((CAST(DATEDIFF(MINUTE, re.StartTime, re.EndTime) AS DECIMAL))/60) AS HoursScheduled, ri.TotalRecurrences *((CAST(DATEDIFF(MINUTE, re.StartTime, re.EndTime) AS DECIMAL))/60) AS TotalHours
FROM dbo.[RecurringEvents] re        
     INNER JOIN dbo.Resources r ON re.ResourceID = r.ID
     
     INNER JOIN dbo.RecurrenceInfo ri ON re.RecurrenceID = ri.ID
     
Where r.ID='1'

 

Regards,
Handy

All times are GMT -5. The time now is 8:29 AM.
Previous Next