Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
94
Web Date Chooser Bug - Selecting None
posted

 

Dear Professional 

I try to solve an issue with what seems a bug in the behavior of  WebDateChooser inside Webgird inside web tab only on first page load. Can you provide your feedback on it. Thanks very in advance!

Here is the story :)

I have couple of pages that I display them inside ultrawebtab (tab is inside a page with master page and that page is the container of all pages we show inside the tab). In one of our, pages that we display inside the tab, I have a data grid and inside the grid, I have couple of WebDateChooser as columns. 

The problem is, the first time (first load), when I click on the date picker and select a date (see screenshot bellow), the date column in the datagrid cell does not get populated! The 2nd time, when I click on the date picker and select a date, it works perfectly fine. There is not page refresh and an other activity between first and 2nd click that is visible to me. I like to know what will happens after I clicked the date picker for the first time that make the picker works but before that, it does not.

I have the same page which is displayed outside of ultrawebtab (this page has a masterpage) which works perfectly fine at the first click! Can you provide me with possible causes so I can try them one by one. Thanks again. Please let me know if my information is not enough so I can provide more detail to it. I may need to just set one or two properties of any of these controls to fix the issue, any help is much appreciated!

P.S. I have removed the ClientSideEvents section completely but still same problem! We are using Microsoft Asp.net 2.0 and the browser is IE 7.0.5730. 

Best Regards

Andy

 

 

<%@ Register Assembly="Infragistics2.WebUI.UltraWebTab.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"

    Namespace="Infragistics.WebUI.UltraWebTab" TagPrefix="igtab" %>

<%@ Register Assembly="Infragistics2.WebUI.WebDateChooser.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"

    Namespace="Infragistics.WebUI.WebSchedule" TagPrefix="igsch" %>

<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"

    Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>

 

<igtbl:UltraWebGrid ID="grdMyGrid" runat="server" OnInitializeLayout="grdMyGrid_InitializeLayout"

                                Height="200px" Width="1000px" OnInitializeRow="grdMyGrid_InitializeRow">

                                <Bands>

                                    <igtbl:UltraGridBand>

                                        <AddNewRow View="NotSet" Visible="NotSet">

                                        </AddNewRow>

                                    </igtbl:UltraGridBand>

                                </Bands>

                                <DisplayLayout BorderCollapseDefault="Separate" Name="grdMyGrid" RowHeightDefault="18px"

                                    Version="4.00" ViewType="Hierarchical" AllowSortingDefault="OnClient" HeaderClickActionDefault="SortMulti"

                                     AllowColSizingDefault="Free" AllowUpdateDefault="Yes"

 

                                    AllowAddNewDefault="Yes" TableLayout="Auto" AllowColumnMovingDefault="OnServer"

                                    SelectTypeRowDefault="Extended" CellClickActionDefault="Edit">

                                    <ClientSideEvents AfterCellUpdateHandler="grdMyGrid_AfterCellUpdateHandler"

                                         InitializeRowHandler="grdMyGrid_InitializeRowHandler" InitializeLayoutHandler="grdMyGrid_InitializeLayoutHandler"

                                        BeforeExitEditModeHandler="grdMyGrid_BeforeExitEditModeHandler" AfterRowInsertHandler="grdMyGrid_AfterRowInsertHandler" BeforeEnterEditModeHandler="grdMyGrid_BeforeEnterEditModeHandler" />

                                    <EditCellStyleDefault BorderWidth="0px" BorderStyle="None">

                                    </EditCellStyleDefault>

                                    <HeaderStyleDefault BackColor="Transparent" BorderStyle="Solid" HorizontalAlign="Left">

                                        <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px"></BorderDetails>

                                    </HeaderStyleDefault>

                                    <ActivationObject BorderWidth="" BorderColor="">

                                    </ActivationObject>

                                </DisplayLayout>

                            </igtbl:UltraWebGrid>

 

 

**initialize layout event inside code behide 

       WebDateChooser2.MaxDate = DateTime.Today;

        grdMyGrid.Bands[0].Columns.FromKey("Service Date*").EditorControlID = WebDateChooser2.UniqueID;

        grdMyGrid.Bands[0].Columns.FromKey("Service Date*").Type = ColumnType.Custom;

        grdMyGrid.Bands[0].Columns.FromKey("Service Date*").CellStyle.HorizontalAlign = HorizontalAlign.Center;                                            grdMyGrid.Columns.FromKey("Service Date*").Width = 80;

        grdMyGrid.DisplayLayout.TableLayout = TableLayout.Fixed;

        grdMyGrid.DisplayLayout.RowStyleDefault.Wrap = true;

 

  • 5
    posted

    Steps:

    1. Add ValueChanged handler to your WebDateChooser referenced by EditorControlID and name the new function: dateEditor_ValueChanged

    2. Add this javascript in your script block:

     

    var m_bFirstDateChange=true;

     

    function dateEditor_ValueChanged(oDateChooser, newValue, oEvent)

    {

        // This fixes a bug when using the WebDateChooser in the UltraWebGrid

        if(m_bFirstDateChange)

        {

            m_bFirstDateChange = false;

            var oNewDate = oDateChooser.getValue();

            var row=igtbl_getActiveRow("my_gridID");

            if(row)

                row.getCell(22).setValue(oNewDate);

        }

    }

     

    3. Change 'my_gridID' to your grid ID

    4. Change the 22 parameter to the column index in your grid