How to Resize Columns when ShowHeader Property is Set to "False" .
<telerik:RadGrid
ID="PMGrdPhone" runat="server" CellPadding="0" AutoGenerateColumns="False"
GridLines="None" ShowHeader="False" AllowMultiRowEdit="True" CellSpacing="0"
TabIndex="19" Skin="Simple">
<HeaderContextMenu EnableAutoScroll="True">
</HeaderContextMenu>
<MasterTableView EditMode="InPlace">
<RowIndicatorColumn Visible="True">
</RowIndicatorColumn>
<Columns>
<telerik:GridTemplateColumn ItemStyle-Width="155px">
<ItemTemplate>
<telerik:RadComboBox ID="tcbNumberType" runat="server" Height="13px"
Width="153px">
</telerik:RadComboBox>
</ItemTemplate>
<ItemStyle Width="155px" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-Width="30px">
<ItemTemplate>
<telerik:RadTextBox ID="txtAreacode" runat="server" Height="13px" Width="27px">
</telerik:RadTextBox>
</ItemTemplate>
<ItemStyle Width="30px" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-Width="58px">
<ItemTemplate>
<telerik:RadTextBox ID="ttxtPhoneNo" runat="server" Height="13px" Width="56px">
</telerik:RadTextBox>
</ItemTemplate>
<ItemStyle Width="58px" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-Width="10px">
<ItemTemplate>
<asp:Label ID="lblExt" runat="server" Text="x" Width="7px"></asp:Label>
</ItemTemplate>
<ItemStyle Width="10px" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-Width="46px">
<ItemTemplate>
<telerik:RadTextBox ID="ttxtExtension" runat="server" Height="13px"
Width="44px">
</telerik:RadTextBox>
</ItemTemplate>
<ItemStyle Width="46px" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderStyle-Width="45px" ItemStyle-Width="45px">
<ItemTemplate>
<asp:Label ID="lblEmail" runat="server" Text="E-mail :" Width="55px"></asp:Label>
</ItemTemplate>
<HeaderStyle Width="45px" />
<ItemStyle Width="45px" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ItemStyle-Width="235px">
<ItemTemplate>
<telerik:RadTextBox ID="ttxtEmailAddress" runat="server" Height="13px"
Width="233px">
</telerik:RadTextBox>
</ItemTemplate>
<ItemStyle Width="235px" />
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
<Resizing AllowColumnResize="True" AllowRowResize="True"
EnableRealTimeResize="True" ResizeGridOnColumnResize="True" />
</ClientSettings>
</telerik:RadGrid>
Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dtContact As DataTable = New DataTable("Contact")
Dim row As DataRow = Nothing
' add columns
dtContact.Columns.Add(
"id", Type.GetType("System.Int32"))
dtContact.Columns.Add(
"NumberType", Type.GetType("System.String"))
dtContact.Columns.Add(
"AreaCode", Type.GetType("System.String"))
dtContact.Columns.Add(
"PhoneNumber", Type.GetType("System.String"))
dtContact.Columns.Add(
"Extension", Type.GetType("System.String"))
dtContact.Columns.Add(
"EmailAddress", Type.GetType("System.String"))
' set PrimaryKey
dtContact.Columns(
"id").Unique = True
dtContact.Rows.Add(1,
"", "", "", "", "")
dtContact.Rows.Add(2,
"", "", "", "", "")
PMGrdPhone.DataSource = dtContact
PMGrdPhone.DataBind()
End Sub
Protected Sub Page_PreRender1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
If Not Page.IsPostBack Then
For Each item As GridDataItem In PMGrdPhone.Items
item.Edit =
True
Next
PMGrdPhone.Rebind()
End If
End Sub
Thanks & Regards
LijiJose