CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    The Columns of the Grid Duplicates themselves

    Good Day All

    After Binding my Grid with 3 Columns , i found out that it Duplicates the Columns Twice. like this

    Code:
    Activity || Staff Member || Cycles  ||  Activity || Staff Member || Cycles || Activity || Staff Member || Cycles 
    
    ===============================================================================
    
    C[1]       || DR  Vuyiswa      ||   Year ||               ||                          ||               ||             ||                          ||
    All other Duplicated Columns have no Values

    and the Grid is defined like this

    Code:
    <igtbl:UltraWebGrid ID="Gridstaff" runat="server" Width="344px" Height="111px" EnableAppStyling="False"
                                                                    StyleSetName="RubberBlack" Autopostback="true" OnSelectedCellsChange="Gridstaff_SelectedCellsChange" OnSelectedColumnsChange="Gridstaff_SelectedColumnsChange" OnSelectedRowsChange="Gridstaff_SelectedRowsChange">
                                                                    <Bands>
                                                                        <igtbl:UltraGridBand>
                                                                            <AddNewRow View="NotSet" Visible="NotSet">
                                                                            </AddNewRow>
                                                                        </igtbl:UltraGridBand>
                                                                    </Bands>
                                                                    <DisplayLayout AllowSortingDefault="OnClient" BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti"
                                                                        Name="ctl172xGridstaff" RowHeightDefault="5px"
                                                                        SelectTypeRowDefault="Extended" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True"
                                                                        TableLayout="Fixed" Version="4.00" ViewType="OutlookGroupBy" ColWidthDefault="180px" EnableProgressIndicator="False" UseFixedHeaders="True">
                                                                        <FrameStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
                                                                            BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Height="111px"
                                                                            Width="344px">
                                                                        </FrameStyle>
                                                                        <Pager MinimumPagesForDisplay="2">
                                                                            <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                                                                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                                                                            </PagerStyle>
                                                                        </Pager>
                                                                        <EditCellStyleDefault BorderStyle="Solid" BorderWidth="0px">
                                                                        </EditCellStyleDefault>
                                                                        <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                                                            <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                                                                        </FooterStyleDefault>
                                                                        <HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid" HorizontalAlign="Left">
                                                                            <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                                                                        </HeaderStyleDefault>
                                                                        <RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                                                                            Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Height="100%" HorizontalAlign="Left" TextOverflow="Ellipsis" Wrap="True">
                                                                            <BorderDetails ColorLeft="Window" ColorTop="Window" />
                                                                        </RowStyleDefault>
                                                                        <GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
                                                                        </GroupByRowStyleDefault>
                                                                        <GroupByBox Hidden="True">
                                                                            <BoxStyle BackColor="ActiveBorder" BorderColor="Window">
                                                                            </BoxStyle>
                                                                        </GroupByBox>
                                                                        <AddNewBox>
                                                                            <BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px">
                                                                                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                                                                            </BoxStyle>
                                                                        </AddNewBox>
                                                                        <ActivationObject BorderColor="" BorderWidth="">
                                                                        </ActivationObject>
                                                                        <FilterOptionsDefault>
                                                                            <FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                                                                                CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
                                                                                Font-Size="11px" Height="300px" Width="200px">
                                                                                <Padding Left="2px" />
                                                                            </FilterDropDownStyle>
                                                                            <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
                                                                            </FilterHighlightRowStyle>
                                                                            <FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
                                                                                BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
                                                                                Font-Size="11px">
                                                                                <Padding Left="2px" />
                                                                            </FilterOperandDropDownStyle>
                                                                        </FilterOptionsDefault>
                                                                        <SelectedRowStyleDefault BackColor="Gray">
                                                                        </SelectedRowStyleDefault>
                                                                        <FixedHeaderStyleDefault Height="100%">
                                                                            <Padding Bottom="2px" />
                                                                        </FixedHeaderStyleDefault>
                                                                    </DisplayLayout>
                                                                </igtbl:UltraWebGrid>
    Thank you
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: The Columns of the Grid Duplicates themselves

    Are you sure you're not populating the grid on post backs? Meaning you'll effectively keep adding to the grid each time you postback the page?

  3. #3
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: The Columns of the Grid Duplicates themselves

    set the "AutoGenerateColumns" property to false.

  4. #4
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: The Columns of the Grid Duplicates themselves

    Thanks , I resolved the Problem by checking for

    Code:
    if(!Page.Ispostback)
    {
    
      BindGrid();
    }
    without this code , it kept rebinding the Grid, but now its Fine.

    Thank you
    Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured