Hi,
I am using following code to define telerik grid, since only one text column in the grid I want it to be 85% width and buttons to be one near each other. This works fine for edit and view operations.
<Columns>
<telerik:GridBoundColumn Display="False" HeaderText="ID" UniqueName="idcolumn" DataField="RoleId">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" CancelImageUrl="~/App_Themes/Gray/Images/grid_cancel.jpg"
EditImageUrl="~/App_Themes/Gray/Images/grid_edit.jpg"
UpdateImageUrl="~/App_Themes/Gray/Images/grid_update.jpg"
InsertImageUrl="~/App_Themes/Gray/Images/grid_update.jpg">
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this Role?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn" ImageUrl="~/App_Themes/Gray/Images/grid_delete.jpg">
</telerik:GridButtonColumn>
<telerik:GridButtonColumn UniqueName="column" CommandName="Select"
Text="Select" ImageUrl="~/App_Themes/Gray/Images/select.jpg"
ButtonType="ImageButton" DataTextField="RoleId" >
</telerik:GridButtonColumn>
<telerik:GridBoundColumn HeaderText="Role Name" UniqueName="rolenamecolumn" DataField="RoleName">
<HeaderStyle Width="85%" />
</telerik:GridBoundColumn>
</Columns>
I use external button to insert a row to the grid. with following code,
protected void rtbTopBar_ButtonClick(object sender, RadToolBarEventArgs e)
{
RadToolBarButton btn = (RadToolBarButton)e.Item;
if (btn.CommandName == "New")
{
grdRoles.MasterTableView.IsItemInserted = true;
grdRoles.Rebind();
}
}
however issue is when insert mode 2 buttons are shown they shown in vertical direction due to lack of width (update button on top of cancel button). I want to find out a way to change the width of a column only in edit or insert modes.
Many Thanks,
Adipa
I am using following code to define telerik grid, since only one text column in the grid I want it to be 85% width and buttons to be one near each other. This works fine for edit and view operations.
<Columns>
<telerik:GridBoundColumn Display="False" HeaderText="ID" UniqueName="idcolumn" DataField="RoleId">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" CancelImageUrl="~/App_Themes/Gray/Images/grid_cancel.jpg"
EditImageUrl="~/App_Themes/Gray/Images/grid_edit.jpg"
UpdateImageUrl="~/App_Themes/Gray/Images/grid_update.jpg"
InsertImageUrl="~/App_Themes/Gray/Images/grid_update.jpg">
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this Role?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn" ImageUrl="~/App_Themes/Gray/Images/grid_delete.jpg">
</telerik:GridButtonColumn>
<telerik:GridButtonColumn UniqueName="column" CommandName="Select"
Text="Select" ImageUrl="~/App_Themes/Gray/Images/select.jpg"
ButtonType="ImageButton" DataTextField="RoleId" >
</telerik:GridButtonColumn>
<telerik:GridBoundColumn HeaderText="Role Name" UniqueName="rolenamecolumn" DataField="RoleName">
<HeaderStyle Width="85%" />
</telerik:GridBoundColumn>
</Columns>
I use external button to insert a row to the grid. with following code,
protected void rtbTopBar_ButtonClick(object sender, RadToolBarEventArgs e)
{
RadToolBarButton btn = (RadToolBarButton)e.Item;
if (btn.CommandName == "New")
{
grdRoles.MasterTableView.IsItemInserted = true;
grdRoles.Rebind();
}
}
however issue is when insert mode 2 buttons are shown they shown in vertical direction due to lack of width (update button on top of cancel button). I want to find out a way to change the width of a column only in edit or insert modes.
Many Thanks,
Adipa