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
80
Webdatagrid - Messed up grid with OnCustomDataBinding and ColumnFixing
posted

Hi,

I use Infragistcs v16.2 and use a webdatagrid to display data fetched from a MSSQL database:

<ig:WebDataGrid ID="dtPlanningWin10Migration"
                runat="server"
                Width="100%"
                DefaultColumnWidth="100px"
                DataKeyFields="id"
                AutoGenerateColumns="false"
                EnableAjax="false"
                EnableAjaxViewState="false"
                EnableViewState="false"
                OnInitializeRow="dtPlanningWin10Migration_OnInitializeRow"
    OnCustomDataBinding="dtPlanningWin10Migration_OnCustomDataBinding">
    <EditorProviders>
        <ig:DropDownProvider ID="installTypeEditorProvider">
            <EditorControl ClientIDMode="Predictable"
                           EnableAutoFiltering="Client"
                           AutoFilterQueryType="Contains"
                           ValueField="NewTamId"
                           TextField="NewName"
                           ID="InstallTypeProvider"
                           OnLoad="InstallTypeProvider_OnLoad"
                           DropDownContainerMaxHeight="200px"
                           EnableAnimations="False"
                           EnableDropDownAsChild="False"
                           runat="server">
            </EditorControl>
        </ig:DropDownProvider>
    </EditorProviders>
    <AjaxIndicator Enabled="True"/>
    <Columns>
        <ig:UnboundCheckBoxField Key="Select" Width="30px"></ig:UnboundCheckBoxField>
        <ig:BoundDataField DataFieldName="id" Key="id" Header-Text="id" Hidden="True"/>
        <ig:BoundDataField DataFieldName="InstallType" Key="InstallType" Header-Text="InstType"/>
    </Columns>
    <EmptyRowsTemplate>
        Keine Clients gefunden
    </EmptyRowsTemplate>
    <Behaviors>
         <ig:ColumnFixing AutoAdjustCells="true" ></ig:ColumnFixing>
        <ig:Paging PagerAppearance="Bottom"
                   PagerMode="NumericFirstLast"
                   Enabled="true"/>
        <ig:EditingCore>
            <EditingClientEvents CellValueChanging="dtPlanningWin10Migration_Grid_CellValueChanged"/>
            <Behaviors>
                <ig:CellEditing Enabled="True">
                    <EditModeActions EnableF2="true" EnableOnActive="true" MouseClick="Single"/>
                    <ColumnSettings>
                        <ig:EditingColumnSetting ColumnKey="Select"/>
                        <ig:EditingColumnSetting ColumnKey="InstallType" EditorID="installTypeEditorProvider"/>
                        <ig:EditingColumnSetting ColumnKey="ImageGeraetId"/>
                    </ColumnSettings>
                </ig:CellEditing>
            </Behaviors>
        </ig:EditingCore>
        <ig:Sorting SortingMode="Multi" Enabled="True">
        </ig:Sorting>
        <ig:Filtering Alignment="Top" Visibility="Visible" Enabled="true" AnimationEnabled="true"/>
    </Behaviors>
</ig:WebDataGrid>

I removed some columns due to brevity.

And I load the data in a custom data binding method:

 protected void dtPlanningWin10Migration_OnCustomDataBinding(object sender, DataBindingEventArgs e)
        {
            WebDataGrid grid = sender as WebDataGrid;
            grid.ScrollTop = 0;
            int currentPage = grid.Behaviors.Paging.PageIndex;
            int pageSize = grid.Behaviors.Paging.PageSize;
            int startIndex = currentPage * pageSize;
            e.Cancel = true;
            int totalCount = 0;
            if (Win10Evaluable == null)
            {
                Win10Evaluable = exprAndFilt.GetWin10Migrations(startIndex, pageSize, out totalCount);
            }
            e.DataSource = Win10Evaluable;
            e.SelectArguments.TotalRowCount = totalCount;
        }

Sometimes as soon as I load the page, I get this exception: https://www.dropbox.com/s/0ji4q0sxwc8zrl9/exception.PNG?dl=0

Furthermore, the grid is sometimes messed up and horizontally scrolling doesn't work anymore: https://www.dropbox.com/s/xlfr4ygel821z7p/messed-up.PNG?dl=0

As soon as I remove the line "<ig:ColumnFixing AutoAdjustCells="true" ></ig:ColumnFixing>", the grid is displayed correctly. So where is the problem with column fixing?

Thanks for your help!

Parents
No Data
Reply
  • 2680
    Offline posted

    Hello Flo,

    Thank you for contacting us.

    I cannot access the two images you wanted to share. You can attach them to a message here in the forum.

    Also, it would be very helpful if you could provide a working isolated sample, if you have one. You can attach it in a .zip.

    I am looking forward to hearing from you.

Children
No Data