We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Grouping Control Set Column Width

Thread ID:

Created:

Updated:

Platform:

Replies:

104005 Jun 14,2012 10:13 PM UTC Jun 22,2012 09:52 AM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: GridGroupingControl
TD
Asked On June 14, 2012 10:13 PM UTC

Hi,
I' am using Grid Grouping Control to display data and having issue setting up column width. It looks like GGC auto-resets the column width. I have to use "MappingName" property to make use of search box.  I tried to use ItemTemplate and added a label to control the width. However, ItemTemplate caused issue while searching data using Search Box and couldn't find any match.

So, is there a way to dynamically set the column width?
otherwise, is there a way to search content using search box if I have to use template control?

Here is the code:

<Syncfusion:GridGroupingControl
    ID="GridGroupingControl1"
    EnableCallbacks="false" 
    ShowSearchBox="true"
    runat="server"                                  
    ShowGroupDropArea="true"
    DataMember="DefaultView"
    DataSourceCachingMode="ViewState"
    AutoFormat="Office 2007 Blue"
    BorderCollapse="Separate"                               
>
    <TableOptions ShowRowHeader="true"></TableOptions>                               
    <TableDescriptor
        AllowFilter="False" AllowNew="false"
        AllowRemove="true" AllowEdit="false"                                   
        >
        <Columns>                                   
        <syncfusion:GridColumnDescriptor
                Width="50" 
                Appearance-AnyCell-AutoSize="false"
                Appearance-AnyRecordFieldCell-AutoSize="false"
                Appearance-AnyRecordFieldCell-WrapText="true"
                Appearance-AnyRecordFieldCell-HorizontalAlignment="Left"                                           
                Appearance-AnyHeaderCell-AutoSize="false"
                AllowGroupByColumn="true"
                AllowSort="true"                                           
                MappingName="TestData1"
                HeaderText="Test Resources">                                           
            </syncfusion:GridColumnDescriptor>
            <syncfusion:GridColumnDescriptor
                Width="20"
                AllowGroupByColumn="true"
                Appearance-AnyRecordFieldCell-HorizontalAlignment="Left"                                           
                MappingName="TestActivity"
                HeaderText="Test Activity">
            </syncfusion:GridColumnDescriptor>
      </Columns>                                   
    </TableDescriptor>                               
</Syncfusion:GridGroupingControl>

Any help would be appreciated. Thanks!

TD
Replied On June 15, 2012 05:13 PM UTC

I found a work-around. "Width" property doesn't work, so I had to use "CssClass" and used "max-width" property to resolve the issue. Well, it at least works on Firefox.

Yogeshwaran [Syncfusion]
Replied On June 18, 2012 06:09 AM UTC

Hi Trushith,

 

Thanks for using Syncfusion products.

 

Your requirement to set column width can be achieved by using ‘TableLayoutMode="Fixed"’ property in GridGroupingControl . After setting

Property “TableLayoutMode” then use “Width” property to set width. Please refer the following code snippet.

 

<Syncfusion:GridGroupingControl ID="GridGroupingControl1" AutoFormat="Office 2007 Blue" TableLayoutMode="Fixed"

                runat="server" DataSourceCachingMode="ViewState" TableOptions-ShowRowHeader="false">

 

 

For your convenience , We have created the sample and the same can be downloaded from below link.

 

ColumnWidth-GridWeb.zip

 

Please let us know if you have any concerns.

 

Regards,

Yogesh R


TD
Replied On June 20, 2012 02:42 PM UTC

Yeap... I think that only works on IE. I am using IE 8, so enabling compatibility mode with above mentioned CSS changes (max-width) works on IE too.

TD
Replied On June 20, 2012 02:43 PM UTC

Thanks for the easy solution though.

Yogeshwaran [Syncfusion]
Replied On June 22, 2012 09:52 AM UTC

Hi Trushith,

 Thanks for your update.

 Please let us know if you have any concerns.

 Regards,

Yogesh R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;