or

private void SaveWorkspacePanels(RadDockZone dockzone,int workspaceid,int panellocation) { try { BusinessLayer BL=new BusinessLayer(); DemandSolutions_WorkspacePanel WorkspacePanel; string source; string [] parsed; string panelid; string paneltype; foreach(RadDock dock in dockzone.Docks) { WorkspacePanel=new DemandSolutions_WorkspacePanel(); source=dock.Tag; parsed=source.Split(' '); panelid=parsed[0]; paneltype=parsed[1]; WorkspacePanel.PanelID=Convert.ToInt32(panelid); WorkspacePanel.PanelLocation=panellocation; WorkspacePanel.WorkspaceID=workspaceid; BL.InsertWorkspacePanel(WorkspacePanel); }//End For-Each } catch(Exception ex) { DisplayMessage.InnerText="Problem with "+dockzone.ID+" "+ex.ToString(); } }//End FunctionRadDock dock=new RadDock();dock.DockMode = DockMode.Docked;dock.ID= string.Format("RadDock{0}", Guid.NewGuid().ToString().Replace('-', 'a'));dock.Tag=panelID+" "+controlType;dock.Title=panelTitle;dock.Text=panelDescription;dock.Width=Unit.Percentage(100);dock.AutoPostBack=true;dock.Commands.Add(new DockExpandCollapseCommand());protected void Page_Init(object sender, EventArgs e) { if (IsPostBack) { pogrid.DataSource = null; pogrid.Rebind(); } else { //... set filteredPOList pogrid.DataSource = null; pogrid.Rebind();public void Selection_Changed(object sender, EventArgs e) { //... } protected void Grid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { pogrid.DataSource = filteredPOList; }<telerik:RadGrid ID="pogrid" runat="server" EnableViewState="true" AutoGenerateColumns="False" OnNeedDataSource="Grid_NeedDataSource" AllowFilteringByColumn="True" AllowSorting="True"ViewStateMode="Enabled" CellSpacing="0" OnSelectedIndexChanged="Selection_Changed" GridLines="None" > <GroupingSettings CaseSensitive="false" /> <ClientSettings EnableRowHoverStyle="True"> <Selecting AllowRowSelect="True" ></Selecting> <Scrolling UseStaticHeaders="True" AllowScroll="True" SaveScrollPosition="True" ScrollHeight="300px"> </Scrolling> <Resizing AllowColumnResize="True"></Resizing> </ClientSettings> <MasterTableView DataKeyNames="poId"> <Columns> <telerik:GridBoundColumn HeaderStyle-Width="20%" HeaderStyle-Font-Bold="true" HeaderText="Promotion Number" UniqueName="PromotionNumber" DataField="PromotionNumber" SortExpression="PromotionNumber" FilterDelay="2000" CurrentFilterFunction="StartsWith" FilterControlWidth="80%" ></telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="40%" HeaderStyle-Font-Bold="true" HeaderText="Promotion Name" UniqueName="PromotionName" DataField="PromotionName" SortExpression="PromotionName" FilterDelay="2000" CurrentFilterFunction="Contains" FilterControlWidth="80%" ></telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="20%" HeaderStyle-Font-Bold="true" HeaderText="Pep Contact" UniqueName="PepContact" DataField="PepContact" SortExpression="PepContact" FilterDelay="2000" CurrentFilterFunction="Contains" FilterControlWidth="80%" ></telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="20%" HeaderStyle-Font-Bold="true" HeaderText="PO Name" UniqueName="POName" DataField="POName" SortExpression="POName" FilterDelay="2000" CurrentFilterFunction="Contains" FilterControlWidth="80%" ></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<ajaxsettings>
<telerik:AjaxSetting AjaxControlID="pogrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pogrid" LoadingPanelID="RadAjaxLoadingPanel1">
</telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</ajaxsettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>

.rgMasterTable
{
width: auto !important;
}
but I get what is on the image
if I try to overwrite the style in the master table view it renders the width attribute twice, like this:
<table cellspacing="0" class="rgMasterTable" id="RadGrid1_ctl00" style="width:100%;width:auto;table-layout:auto;empty-cells:show;">
I want that the colums width adjusts to the content, It works if I put the grid inside a table td but there must be a better way
also works inside a div with display:inline-table but not in IE7
I'm using Q1 2010
please advise
thanks!
code:
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" onneeddatasource="RadGrid1_NeedDataSource"> <MasterTableView style="width:auto;"> </MasterTableView> </telerik:RadGrid>