protected
void
CompleteTickets_ItemCommand(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName ==
"Refresh"
)
{
CompleteTicketsGrid.Rebind();
}
if
(e.CommandName ==
"Download"
)
{
// Get Ticket ID
GridDataItem item = (GridDataItem)e.Item;
int
ticketID = Convert.ToInt32(item.GetDataKeyValue(
"TicketID"
));
// Use Ticket ID to Get File from File Repository
}
}
int
ticketID = Convert.ToInt32(item[
"TicketID"
].Text);
<telerik:RadGrid
runat=
"server"
ID=
"CompleteTicketsGrid"
Enabled=
"true"
Width=
"100%"
AutoGenerateColumns=
"false"
Skin=
"Default"
GroupingEnabled=
"false"
PageSize=
"10"
AllowPaging=
"true"
OnNeedDataSource=
"CompleteTickets_OnNeedDataSource"
OnItemCommand=
"CompleteTickets_ItemCommand"
>
<MasterTableView
DataKeyNames=
"TicketID"
CommandItemDisplay=
"Top"
CommandItemSettings-ShowRefreshButton=
"true"
CommandItemSettings-ShowAddNewRecordButton=
"false"
CommandItemStyle-HorizontalAlign=
"NotSet"
TableLayout=
"Fixed"
Name=
"Unpriced"
AllowPaging=
"true"
>
<Columns>
<telerik:GridBoundColumn UniqueName=
"TicketID"
DataField=
"TicketID"
HeaderStyle-Width=
"5%"
ItemStyle-Width=
"5%"
HeaderText=
"#"
></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName=
"Customer"
DataField=
"Customer"
HeaderStyle-Width=
"15%"
ItemStyle-Width=
"15%"
HeaderText=
"Customer"
></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName=
"Location"
DataField=
"Location"
HeaderStyle-Width=
"18%"
ItemStyle-Width=
"18%"
HeaderText=
"Location"
></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName=
"JobNo"
DataField=
"JobNo"
HeaderStyle-Width=
"9%"
ItemStyle-Width=
"9%"
HeaderText=
"Job #"
></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName=
"CreatedDate"
DataField=
"DateCreated"
HeaderStyle-Width=
"11%"
ItemStyle-Width=
"11%"
HeaderText=
"Date Created"
ReadOnly=
"true"
DataFormatString=
"{0:d/M/yyyy}"
></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName=
"OrderedBy"
DataField=
"OrderedBy"
HeaderStyle-Width=
"11%"
ItemStyle-Width=
"11%"
HeaderText=
"Ordered By"
ReadOnly=
"true"
></telerik:GridBoundColumn>
<telerik:GridButtonColumn UniqueName=
"Download"
ButtonType=
"LinkButton"
Text=
"Download"
CommandName=
"Download"
ItemStyle-Width=
"12%"
HeaderStyle-Width=
"12%"
/>
<telerik:GridButtonColumn UniqueName=
"LoadTicket"
ButtonType=
"LinkButton"
Text=
"Load Ticket"
CommandName=
"LoadTicket"
ItemStyle-Width=
"13%"
HeaderStyle-Width=
"13%"
/>
</Columns>
</MasterTableView>
<ItemStyle Height=
"40"
VerticalAlign=
"Middle"
/>
<AlternatingItemStyle Height=
"40"
BackColor=
"CadetBlue"
ForeColor=
"White"
VerticalAlign=
"Middle"
/>
<ClientSettings>
<ClientEvents OnCommand=
"OnGridCommand"
/>
<Scrolling AllowScroll=
"False"
UseStaticHeaders=
"True"
/>
</ClientSettings>
</telerik:RadGrid>
// Disables Ajax on Buttons Clicked in Grid
//
function
OnGridCommand(sender, args) {
var
itemArgument = args.get_commandArgument();
var
itemCommand = args.get_commandName();
if
(itemArgument ==
"DisableAjax"
|| itemCommand ==
"Download"
) {
window[
"disableAjax"
] =
true
;
}
else
{
window[
"disableAjax"
] =
false
;
}
args.set_cancel(
false
);
}
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="WebApplication8._default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
asp:ScriptManager
ID
=
"sm"
runat
=
"server"
></
asp:ScriptManager
>
<
asp:UpdatePanel
ID
=
"upError"
runat
=
"server"
ChildrenAsTriggers
=
"true"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
asp:Button
ID
=
"btnError"
runat
=
"server"
Text
=
"Error"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
<
asp:Button
ID
=
"btnErrorNoUpdatePanel"
runat
=
"server"
Text
=
"ErrorNoUpdatePanel"
/>
</
div
>
</
form
>
</
body
>
</
html
>
Public Class _default
Inherits System.Web.UI.Page
Private Sub _default_PreInit(sender As Object, e As System.EventArgs) Handles Me.PreInit
If Me.IsPostBack Then
Throw New Exception("Test")
End If
End Sub
Private Sub sm_AsyncPostBackError(sender As Object, e As System.Web.UI.AsyncPostBackErrorEventArgs) Handles sm.AsyncPostBackError
Server.ClearError()
Response.Redirect("Error.aspx")
End Sub
End Class
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Error.aspx.vb" Inherits="WebApplication8._Error" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
An error occured!
</
div
>
</
form
>
</
body
>
</
html
>
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
system.web
>
<
customErrors
mode
=
"Off"
/>
<
compilation
debug
=
"true"
strict
=
"false"
explicit
=
"true"
targetFramework
=
"4.0"
/>
<
httpModules
>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
httpModules
>
</
system.web
>
<
system.webServer
>
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
remove
name
=
"RadCompression"
/>
<
add
name
=
"RadCompression"
preCondition
=
"managedHandler"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
modules
>
</
system.webServer
>
</
configuration
>
Imports System.Web.SessionState
Public Class Global_asax
Inherits System.Web.HttpApplication
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
Server.ClearError()
Response.Redirect("Error.aspx")
End Sub
End Class
<
telerik:RadGrid
runat="server"
ID="grdTypes"
Skin="Office2007"
EnableEmbeddedSkins="True"
AllowAutomaticDeletes="True"
AllowAutomaticUpdates="True"
AutoGenerateColumns="False"
AllowMultiRowEdit="True"
EnableAJAX="True"
GridLines="None"
Width="400px"
OnNeedDataSource="grdTypes_NeedDataSource"
OnDeleteCommand="grdTypes_DeleteCommand"
>
<ExportSettings>
<Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in"
PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" />
</ExportSettings>
<MasterTableView
CommandItemDisplay="Top"
EditMode="EditForms"
DataKeyNames="TypesID"
AutoGenerateColumns="false"
AllowSorting = "true">
<EditFormSettings>
<EditColumn CancelImageUrl="/next/RadControls/Grid/Skins/TEST/Cancel.gif" EditImageUrl="/next/RadControls/Grid/Skins/TEST/Edit.gif"
InsertImageUrl="/next/RadControls/Grid/Skins/TEST/Update.gif" UniqueName="EditCommandColumn2"
UpdateImageUrl="/next/RadControls/Grid/Skins/TEST/Update.gif">
</EditColumn>
</EditFormSettings>
<CommandItemTemplate >
<asp:LinkButton ID="InitInsertButton" runat="server" CommandName="InitInsert" >
<img alt="Add Record" src="/next/RadControls/Grid/Skins/TEST/AddRecord.gif" /> Add new record</asp:LinkButton>
</CommandItemTemplate>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit">
<ItemStyle Width="10px"/>
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn
CommandName="Delete"
ConfirmText="Are you sure you wish to delete this record?"
Text="Delete"
HeaderText="Delete"
ImageUrl="/next/RadControls/Grid/Skins/Test/Delete.gif"
UniqueName= "DeleteColumn2"
ButtonType="ImageButton"
ShowSortIcon="False"
>
<ItemStyle Width="10px"/>
</telerik:GridButtonColumn>
<telerik:GridBoundColumn Visible="false" ReadOnly="true" DataField="TypesID" UniqueName="TypesID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn Visible="false" ReadOnly="true" DataField="DDID" UniqueName="DDID">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn
DataField="TypesID"
HeaderText="Types"
UniqueName="TypesID"
DataSourceID="myTypes"
ListValueField="TypesID"
ListTextField="TypeName"
DropDownControlType="DropDownList"
>
<ItemStyle Width="210px"/>
</telerik:GridDropDownColumn>
</Columns>
<ExpandCollapseColumn Resizable="False" Visible="False">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
</MasterTableView>
<FilterMenu EnableEmbeddedSkins="False" EnableTheming="True" Skin="TEST">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>
I have a Template EditForm that contains a table with cells that contain an nested table with some text in the top row and a radio button in the bottom row. My problem is that I am unable to get the radio button to center in the nested table. I looked in the rendered html and I think that there are styles that are overriding my settings. Can you recommend how to accomplish centering the radio button?
Thanks,
Anne
<FormTemplate>
<table cellspacing="0" cellpadding="2" class="General">
<tr>
<td colspan="5" class="DefaultGridCell"><br /><asp:Label ID="Edit_RubricTitle" runat="server" /></td>
</tr>
<tr>
<td class="DefaultGridCell">ELEMENT</td>
<td style="width:150px"class="DefaultGridCell">UNSATISFACTORY</td>
<td style="width:150px"class="DefaultGridCell">BASIC</td>
<td style="width:150px"class="DefaultGridCell">PROFICIENT</td>
<td style="width:150px"class="DefaultGridCell">DISTINGUISHED</td>
</tr>
<tr>
<td class="DefaultGridCell" valign="top" align="center">
<asp:Label ID="Edit_ElementTitle" runat="server" />
</td>
<td class="DefaultGridCell" valign="top" align="center">
<table cellspacing="0" cellpadding="2">
<tr>
<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL1" runat="server" /></td>
</tr>
<tr>
<td>
<asp:RadioButton ID="CB_DescriptorPL1" GroupName="Group1" runat="server" />
</td>
</tr>
</table>
</td>
<td class="DefaultGridCell" valign="top" align="center">
<table cellspacing="0" cellpadding="2">
<tr>
<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL2" runat="server" /></td>
</tr>
<tr>
<td align="center">
<asp:RadioButton ID="CB_DescriptorPL2" GroupName="Group1" runat="server" />
</td>
</tr>
</table>
</td>
<td class="DefaultGridCell" valign="top" align="center">
<table cellspacing="0" cellpadding="2">
<tr>
<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL3" runat="server" /></td>
</tr>
<tr>
<td align="center">
<asp:RadioButton ID="CB_DescriptorPL3" GroupName="Group1" runat="server" />
</td>
</tr>
</table>
</td>
<td class="DefaultGridCell" valign="top" align="center">
<table cellspacing="0" cellpadding="2">
<tr>
<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL4" runat="server" /></td>
</tr>
<tr>
<td align="center">
<asp:RadioButton ID="CB_DescriptorPL4" GroupName="Group1" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="5">
<telerik:RadButton ID="btnUpdate" Text='<%# (Container is TreeListEditFormInsertItem) ? "Insert" : "Update" %>'
runat="server" CommandName='<%# (Container is TreeListEditFormInsertItem) ? "PerformInsert" : "Update" %>'
Icon-PrimaryIconCssClass="rbOk">
</telerik:RadButton>
<telerik:RadButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
</telerik:RadButton>
</td>
</tr>
</table>
</FormTemplate>
ItemDataBound
of my parent radgrid...
Many thanks