<telerik:RadGrid ID="RadGrid2" DataSourceID="SqlDataSource3" GridLines="None" ShowGroupPanel="False" Skin="WebBlue" runat="server"
AutoGenerateEditColumn="True" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true">
<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" HideStructureColumns="true"></ExportSettings>
<MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource3"
ShowHeader="True" AllowPaging="false" CommandItemDisplay="Top">
<Columns>
<telerik:GridBoundColumn DataField="intInspectorID" DataType="System.Int32" HeaderText="intInspectorID"
SortExpression="intInspectorID" UniqueName="intInspectorID" Visible="false" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="intCertificationID" DataType="System.Int32" HeaderText="intCertificationID"
SortExpression="intCertificationID" UniqueName="intCertificationID" Visible="false" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="strCertificationDesc" HeaderText="Certification" SortExpression="strCertificationDesc"
UniqueName="strCertificationDesc">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="dtmDateExpires" HeaderText="Date Expires" SortExpression="dtmDateExpires"
UniqueName="dtmDateExpires">
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ConfirmText="Delete this Certification?" ButtonType="LinkButton"
CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">
<HeaderStyle Width="20px" />
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table style="width:100%; table-layout:fixed; margin: 0 0 0 0; background-color:#E6E6E6;">
<tr>
<td align="right" style=" vertical-align:top;">
<asp:Label ID="Label3" runat="server" Text="Certification:"></asp:Label>
</td>
<td align="left">
<telerik:RadComboBox ID="cboStateEdit" runat="server" DataTextField='<%# Bind("strCertificationDesc") %>'
DataValueField='<%# Bind("intCertificationID") %>' Text='<%# Bind("strCertificationDesc") %>'
SelectedValue='<%# Bind("intCertificationID") %>' Skin="WebBlue">
<Items>
<telerik:RadComboBoxItem Text="--Select--" Value="" />
<telerik:RadComboBoxItem Text="NICET" Value="1" />
<telerik:RadComboBoxItem Text="NICEPT" Value="2" />
<telerik:RadComboBoxItem Text="ACI" Value="3" />
<telerik:RadComboBoxItem Text="PennDOT Concrete" Value="4" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td align="right" style=" vertical-align:top;">
<asp:Label ID="Label15" runat="server" Text="Date Expires:"></asp:Label>
</td>
<td align="left">
<telerik:RadDatePicker ID="RadDatePicker1" runat="server"
DbSelectedDate='<%# Bind("dtmDateExpires") %>' EnableTyping="false">
</telerik:RadDatePicker>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
</asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:inspectors %>"
SelectCommand="getInspectorCertifications" SelectCommandType="StoredProcedure"
InsertCommand="insInspectorCertifications" InsertCommandType="StoredProcedure"
UpdateCommand="updInspectorCertifications" UpdateCommandType="StoredProcedure"
DeleteCommand="delInspectorCertification" DeleteCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" Name="intInspectorID" PropertyName="Text" Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:ControlParameter ControlID="Label1" Name="intInspectorID" PropertyName="Text" Type="Int32" />
<asp:Parameter Name="intCertificationID" Type="Int32" />
<asp:Parameter Name="dtmDateExpires" Type="DateTime" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="intCertificationID" Type="Int32" />
<asp:Parameter Name="intInspectorID" Type="Int32" />
<asp:Parameter Name="dtmDateExpires" Type="dateTime" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="intCertificationID" Type="Int32" />
<asp:Parameter Name="intInspectorID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
</
telerik:RadPageView>
If I specify a width on the grid and the mastertableview, the grid isn't centered on the screen.
If I remove the width on the grid it is centered.
If I set UseStaticHeaders="False" the command template is the same width as the mastertableview and centered.
If I set UseStaticHeaders="True" the command tamplate width is 100% of the screen and the mastertableview is centered.
We've never been able to use HorizontalAlign=
"Center"
becuase we've never seen it work as expected, so we've been wrapping out grids in a <table> to center them.
Is there something I'm missing?
<
telerik:RadGrid
ID
=
"RadGrid1"
HorizontalAlign
=
"Center"
runat
=
"server"
AllowPaging
=
"false"
AllowSorting
=
"True"
GridLines
=
"None"
BorderWidth
=
"0"
PageSize
=
"5"
BackColor
=
"White"
GroupingEnabled
=
"False"
CellSpacing
=
"0"
Width
=
"750"
>
<
MasterTableView
Name
=
"RepMaster"
HorizontalAlign
=
"Center"
Width
=
"750"
CommandItemDisplay
=
"Top"
BorderStyle
=
"Solid"
BorderWidth
=
"1"
BorderColor
=
"Black"
TableLayout
=
"Fixed"
>
<
CommandItemTemplate
>
<
table
border
=
"0"
style
=
"width: 100%;"
>
<
tr
>
<
td
align
=
"left"
style
=
"width: 125px;"
>
<
asp:Button
CausesValidation
=
"false"
CommandName
=
"InitInsert"
runat
=
"server"
ID
=
"btnAddNewRecord"
Text
=
" "
title
=
"Add new record"
CssClass
=
"rgAdd"
/>
<
asp:LinkButton
CausesValidation
=
"false"
ID
=
"lnkbAddNewRecord"
CommandName
=
"InitInsert"
runat
=
"server"
CssClass
=
"Link"
>Add new Record</
asp:LinkButton
>
</
td
>
<
td
align
=
"center"
>
</
td
>
<
td
align
=
"right"
style
=
"width: 125px;"
>
<
asp:Button
CausesValidation
=
"false"
CommandName
=
"RebindGrid"
runat
=
"server"
ID
=
"btnRefresh"
Text
=
" "
title
=
"Refresh"
CssClass
=
"rgRefresh"
/>
<
asp:LinkButton
CausesValidation
=
"false"
ID
=
"lnkbRefresh"
CommandName
=
"RebindGrid"
runat
=
"server"
CssClass
=
"Link"
>Refresh</
asp:LinkButton
>
</
td
>
</
tr
>
</
table
>
</
CommandItemTemplate
>
<
CommandItemStyle
BackColor
=
"AliceBlue"
Width
=
"500"
HorizontalAlign
=
"Center"
/>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"RepMasterEdit"
HeaderText
=
"Edit"
>
<
HeaderStyle
HorizontalAlign
=
"Center"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"imgbEdit"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Select"
CssClass
=
"Link"
ImageUrl
=
"~/Images/btnEdit.gif"
ToolTip
=
"Edit"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
EnableDragToSelectRows
=
"False"
></
Selecting
>
<
Scrolling
AllowScroll
=
"True"
ScrollHeight
=
"100%"
UseStaticHeaders
=
"true"
></
Scrolling
>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Private Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
Dim dt As New DataTable
'Add our columns
For i As Integer = 0 To 5
dt.Columns.Add("Field" + i.ToString, GetType(String))
Next
Dim row As DataRow
For r As Integer = 0 To 50
row = dt.NewRow
For c As Integer = 0 To 5
row("Field" + c.ToString) = "Value " + r.ToString
Next
dt.Rows.Add(row)
Next
Me.RadGrid1.DataSource = dt
End Sub
GridHyperLinkColumn gridHyperLinkColumn = new GridHyperLinkColumn();
gridHyperLinkColumn.AllowFiltering = true;
gridHyperLinkColumn.CurrentFilterFunction = GridKnownFunction.Contains;
gridHyperLinkColumn.ShowFilterIcon = false;
gridHyperLinkColumn.AutoPostBackOnFilter = true;
<
telerik:RadDataPager
ID
=
"RadDataPager1"
runat
=
"server"
PagedControlID
=
"RadListBox1"
>
</
telerik:RadDataPager
>
<
telerik:RadListBox
ID
=
"RadListBox1"
runat
=
"server"
AutoPostBack
=
"True"
DataKeyField
=
"EventLocation"
DataSourceID
=
"Listbox"
DataTextField
=
"EventLocation"
DataValueField
=
"EventLocation"
DlisataKeyField
=
"EventLocation"
Skin
=
"Black"
allowpaging
=
"true"
style
=
"z-index: 1; left: 1109px; top: 114px; position: absolute; height: 48px; width: 155px; text-align: center;"
> <
ButtonSettings
TransferButtons
=
"All"
/>
</
telerik:RadListBox
>
When i run my aspx page, it doesnt show any paging
I'm trying to write a workaround for the bug in your RadTabStrip control that prevents tabs from being hidden and displayed on demand.
So instead of building the tabstrip with some tabs hidden, I now add only the tab items I want displayed initially, then use javascript to add further tab items later.
Here's a snippet of the js code...
var
tabStrip = $find(
'myTabStrip'
);
var
tab =
new
Telerik.Web.UI.RadTab();
tab.set_text(
'text'
);
tab.set_value(
'pseudo-id_because_ID_field_is_weirdly_not_supported'
);
var
attributes = tab.get_attributes();
attributes.setAttribute(
"onclick"
,
"alert('hello')"
);
tabStrip.get_tabs().insert(1, tab);
this runs ok and adds a tab to the page, but the attribute is never set, and when I look at the page source it has never been rendered. The items rendered using server side code with the same settings work fine.
Is there something else I should be doing, or is this another bug?