User Profile & Activity

Frank P Member
Page
of 8

Yes, updating seems to have solved a number of problems. I have not completed testing for the WebGrid, but I am hopeful.

I am still testing the webgrid, but have encountered the same problem. When calling a custom "InvokeCustomEvent" with the gridId as a parameter, I am seeing the following in the "arguments" list:

"<INPUT style="Z-INDEX: 199; POSITION: absolute; TEXT-ALIGN: right; WIDTH: 83px; HEIGHT: 24px; OVERFLOW: hidden; TOP: 118px; LEFT: 575px" id=grdVariance_TB class=WG5E-ET value=1,4 autocomplete="off" origLeft="575" origTop="118" isDirty="true">"

The value should be "1.4" not "1,4".

 

I opened a new question for the "^" entry problem. It is here.

I updated my controls and it now works as expected for display and entry. Thank you.

If I change my currency symbol to "^" (our test symbol for currency), I receive the javascript error in the image.

The lower right cut-out is another screen shot that shows the string value ("^") of "vd0c17".

 

After the update, where do I place the ".js" files to make certain they are being loaded properly. Our process takes the .dll files and moves them to a separate TFS directory and are referenced from there. Where should I put the script files/folders?

The proposed answer (Yudi Member / Posted: September 12, 2011 10:50 PM ) does not handle the different cultures question for entry or display.

Entering the value "3,4" in the text box returns a value "34,0000" which is incorrect.
If I enter "3.4", the label displays "$ 3,4000" - which is the value I expect to display when entering "3,4".
I can get it to display correctly, the edit process is not working as expected.

 

On a related note, I am having the same problem with the WebGrid when the cell is editable and contains a decimal value.


See the code below (modified from earlier sample)

----------------
CodeBehind:
public partial class DisplayAndFormatNumericFormat : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (! Page.IsPostBack) {
WebInput1.Value = "2.25";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = WebInput1.Text;
}
}

ASPX:
<form id="form1" runat="server">
<div>
<ISWebInput:WebInput ID="WebInput1" runat="server" Width="75px" AcceptEnter="false"
MaxLength="7" DecimalSeparator=",">
<DisplayFormat Format="$ #,##0.0000" IsEnabled="True" Type="Number">
<ErrorWindowInfo IsEnabled="True">
</ErrorWindowInfo>
</DisplayFormat>
<EditFormat Format="#,###,##0.0" IsEnabled="True" Type="Number">
<MaskInfo MaskExpression="9,999,990.0" SkipOptional="False">
</MaskInfo>
<ErrorWindowInfo IsEnabled="True">
</ErrorWindowInfo>
</EditFormat>
<CultureInfo CultureName="id-ID">
</CultureInfo>
<HighLight IsEnabled="True" />
</ISWebInput:WebInput>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
 
------- OR -------
<div>
<ISWebInput:WebInput ID="WebInput1" runat="server" Width="75px" AcceptEnter="false"
MaxLength="7" DecimalSeparator=",">
<DisplayFormat Format="$ #.##0,0000" IsEnabled="True" Type="Number">
<ErrorWindowInfo IsEnabled="True">
</ErrorWindowInfo>
</DisplayFormat>
<EditFormat Format="#.###.##0,0" IsEnabled="True" Type="Number">
<MaskInfo MaskExpression="9.999.990,0" SkipOptional="False">
</MaskInfo>
<ErrorWindowInfo IsEnabled="True">
</ErrorWindowInfo>
</EditFormat>
<CultureInfo CultureName="id-ID">
</CultureInfo>
<HighLight IsEnabled="True" />
</ISWebInput:WebInput>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>

Where is parsing being performed before the WebFlyPostBackMethod is initiated?

That is my problem exactly. We are not using a mask nor do we want to use a mask. I have changed the display format to match the culture (#.###,0000), but it does not work properly.

 

Where is parsing being performed before the WebFlyPostBackMethod is initiated?

 

Relevant .aspx:

 <ISWebDesktop:WebFlyPostBackManager ID="ctlPostbackManager" runat="server" ServiceUrl="~/currentPage.aspx">
<FlyPostBackSettings PostControlState="false" PostHiddenFields="false" PostInputControls="false" PostViewState="false" />
<ClientSideEvents OnResponseSuccess="OnFlyResponseSuccess" OnError="OnFlyPostBackError" />
</ISWebDesktop:WebFlyPostBackManager>

<IS:WebGrid ID="grdHONew" runat="server" Height="100%" Width="100%" style="height:100%;width:100%;" ToolbarId="tlbHO" PreserveExpandCollapseState="false">
<LayoutSettings AllowEdit="Yes" AllowColumnFreezing="Yes" AllowSorting="No" AllowColumnMove="No" AllowColumnSizing="Yes" CellClickAction="RowSelect" AllowContextMenu="False">
<ClientSideEvents OnInitialize="FixRowExpandStatus();" OnExitEditMode="OnExitEditMode" OnEnterEditMode="OnEnterEditMode" OnBeforeUpdate="OnBeforeUpdate" OnAfterUpdate="OnAfterUpdate" OnRowValidate="OverridesValidate" />
<FreezePaneSettings ActiveFrozenColumns="1" AbsoluteScrolling="true" />
</LayoutSettings>
<ExtendedSettings>
<ColumnHScroll Enabled="true" />
</ExtendedSettings>
<UserLayoutSettings ObjectName="FORECAST/HISTORICAL_OVERRIDES_NEW" />
</DT:WebGridEx>

 

JS: 
function CheckDelayedSave(retvalue) {
    if (event && event.toElement != null && ISGetObject('tlbHO').Commands.GetNamedItem('cmdSave')._HtmlObj.id == event.toElement.id)
        SaveOverrides();
    return retvalue;
} function

GetPBM() {return ISGetObject("ctlPostbackManager");} function OnExitEditMode(gridId,tblName,editObject) {if (lastEditcellElement == 'Exit') {lastEditcellElement = null;return true;

}

var newValue = editObject.element.value;var celEl = editObject.cellElement;

lastEditcellElement = celEl;

if (newValue.length > 0 && isNaN(newValue)) {

editObject.element.value=celEl.innerText;

return CheckDelayedSave(true);

}

if (newValue.trim() == celEl.innerText.trim() || parseFloat(newValue) == parseFloat(celEl.innerText)) return CheckDelayedSave(true);if (!OverrideValidate(newValue)) return CheckDelayedSave(false); var pbm = GetPBM();if (pbm.IsBusy())

pars.push(GetGrid().GetSelectedObject().ToRowObject().KeyValue

+
'$$$' + GetGrid().GetColumnByElement(celEl).DataMember+ '$$$' + newValue);else {

pbm.OnValueChanged(GetGrid().GetSelectedObject().ToRowObject().KeyValue

, GetGrid().GetColumnByElement(celEl).DataMember

, newValue);

SetCalculatingStatus();

}

editObject.element.value=celEl.innerText;

return CheckDelayedSave(true);

}

 

CodeBehind (never reaches):

    <WebFlyPostBackMethod()> _
    Public Function OnValueChanged(ByVal key As String, ByVal colName As String, ByVal newValue As String) As String()
        Dim ret As New List(Of String)
        CalculateOneColumn(ret, key, colName, newValue)
        Return ret.ToArray()
    End Function

Change the configuration to use a different culture.

No mask is used.

 

Posted: September 12, 2011 2:55 PM

I did find this post

http://www.intersoftpt.com/Support/WebGrid/KB/Client-Server-Interaction-by-Utilizing-a-WebGrid-OnTheFly-PostBack/

but I have a page with aobut 21 fields I'd like to populate when the grid row is selected - some of which are hidden/visible based on other fields.

All times are GMT -5. The time now is 7:21 AM.
Previous Next