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
195
How to resize columns in code behind
posted

I have a simple Aikido Webdatagrid that handles a variety of database tables and so the column names are unknown.  I have the grid set up to autogenerate the columns so how can I set the pixel width to a default value?  The reason is that without each and every column's width specified, I cannot view the right-most columns as they are chopped off because that's the only way to activate the horizontal scrollbar for the grid.

<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="100%" DataKeyFields="ROWNUM" EnableDataViewState="True" AltItemCssClass="coloredRow">

                            <Behaviors>

                                <ig:Sorting SortingMode="Multi">

                                </ig:Sorting>

                                <ig:Selection CellClickAction="Row" RowSelectType="Single" Enabled="False">

                                </ig:Selection>

                                <ig:ColumnResizing>

                                </ig:ColumnResizing>

                                <ig:VirtualScrolling>

                                </ig:VirtualScrolling>

                            </Behaviors>

                            <AjaxIndicator Enabled="True" BlockArea="Control" ImageUrl="~/ig_res/Default/images/ig_progressIndicator.gif" />

                        </ig:WebDataGrid>

 

Parents
No Data
Reply
  • 33839
    Verified Answer
    posted

    Hey,

    Since you are autogenerating the columns,they do not get placed in the grid's columns collection on the server.  So you can not individually set the width.  If you are using 9.2, you can set the DefaultColumnWidth property to a value, say "100px", and each column should get that width.  I hope this helps.

     

    regards,

    David Young

Children