| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadDatePicker ID="rdtpBegin" runat="server" SharedCalendarID="sharedCalendar" /> |
| <telerik:RadDatePicker ID="rdtpEnd" runat="server" SharedCalendarID="sharedCalendar" /> |
| <telerik:RadCalendar ID="sharedCalendar" runat="server" /> |
| <script type="text/javascript"> |
| var picker = $find("<%= rdtpBegin.ClientID %>"); |
| if (picker.get_selectedDate() == null) { |
| var defaultDate = new Date(); |
| picker.control.set_selectedDate(defaultDate); |
| } |
| </script> |
<telerik:RadGrid ID="grdExams" runat="server" ondetailtabledatabind="grdExams_DetailTableDataBind">
<GroupPanel Visible="True">
</GroupPanel>
<MasterTableView GridLines="None" DataKeyNames="ID" DataSourceID="LinqDataSource1"
CommandItemDisplay="TopAndBottom" Width="100%" Name="Examinations">
<DetailTables>
<telerik:GridTableView HierarchyLoadMode="Client" DataSourceID="LinqDataSource2" DataKeyNames="ID"
Width="100%" runat="server" CommandItemDisplay="Bottom" AllowAutomaticDeletes="true"
AllowFilteringByColumn="false" Name="Detractions">
<ParentTableRelation>
<telerik:GridRelationFields MasterKeyField="ID" DetailKeyField="ExaminationID" />
</ParentTableRelation>
<EditFormSettings>
<PopUpSettings ScrollBars="None"></PopUpSettings>
</EditFormSettings>
<CommandItemTemplate>
<asp:LinkButton ID="lnkAddDetraction" runat="server" CommandName="InitInsert" >
I want to find the above link button "lnkAddDetraction"...
Thanks.
<telerik:RadGrid ID="RadGrid1" runat="server" width="400">
<MasterTableView width="400" AutoGenerateColumns="false">
<Columns>
<telerik:GridBoundColumn HeaderText="ID" DataField="ID" >
<ItemStyle width="200"/></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Test" DataField="JourneyNo" >
<ItemStyle width="200"/></telerik:GridBoundColumn>
</Columns>
<
ItemTemplate>
<
asp:label id="header" visible="false" runat="server" style="display:block"/>
<
table>
<
tr>
<
td><asp:label id="column1" runat="server" Width="200"/></td>
<
td><asp:label id="column2" runat="server" Width="200"/></td>
<
tr>
</
table>
</
ItemTemplate>
</
MasterTableView>
</telerik:RadGrid>
I'm having problems with the visual appearance. Firstly there are grey lines in the rows i think because i am using tables and secondly I can't get the 'columns' in the item template to line up with columns in the header
Please can you advise how I can sort out the appearance
thanks
I just tried to figure out how to add a RequiredFieldValidator to an GridDateTimeColumn.
I tried the code from this example in the documentation, but it didn't work for the DateTimeColumn because editor.TextBoxControl is always null. Instead you have to get a reference to the PickerControl:
| void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) |
| { |
| if (e.Item.IsInEditMode && e.Item is GridEditableItem) |
| { |
| GridEditableItem item = e.Item as GridEditableItem; |
| GridDateTimeColumnEditor dateEditor = item.EditManager.GetColumnEditor("StartDate") as GridDateTimeColumnEditor; |
| // Adding a validator to the DateTimeColumn. This one works |
| if (dateEditor != null && dateEditor.PickerControl != null) |
| { |
| TableCell cell = dateEditor.PickerControl.Parent as TableCell; |
| //Don't set the id here. Otherwise you'll get an exception |
| //dateEditor.PickerControl.ID = "StartDate_ID_Validation"; |
| RequiredFieldValidator validator = new RequiredFieldValidator(); |
| validator.ControlToValidate = dateEditor.PickerControl.ID; |
| validator.ErrorMessage = "StartDate required"; |
| cell.Controls.Add(validator); |
| } |
| } |
| } |
I don't know if this is the desired behaviour or a bug (I mean TextBoxControl being null), but it works fine.
Best regards
Sebastian
protected void btnPDF_Click(object sender, EventArgs e)
{
RadGrid1.ExportSettings.ExportOnlyData =
true;
RadGrid1.ExportSettings.IgnorePaging =
true;
RadGrid1.ExportSettings.OpenInNewWindow =
true;
RadGrid1.MasterTableView.ExportToPdf();
}
<
telerik:RadGrid ID="RadGrid1" runat="server"
AllowPaging="True" AllowSorting="True"
GridLines="None" onneeddatasource="RadGrid_NeedDataSource"
ShowGroupPanel="True" HorizontalAlign="Center"
oncolumncreated="RadGrid1_ColumnCreated"
ongroupschanging="RadGrid1_GroupsChanging"
onitemdatabound="RadGrid1_ItemDataBound" Skin="Office2007"
SkinID="Office2007" PageSize="50" >
<ExportSettings OpenInNewWindow="True">
</ExportSettings>
<mastertableview cellpadding="10" gridlines="None" ShowGroupFooter="True"
GroupsDefaultExpanded="False"><rowindicatorcolumn visible="False"><HeaderStyle Width="90px" /></rowindicatorcolumn><expandcollapsecolumn visible="False"><HeaderStyle Width="90px" /></expandcollapsecolumn><editformsettings><formtablestyle /><popupsettings scrollbars="None" /></editformsettings><ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" Width="100px" Wrap="False" />
<GroupHeaderItemStyle Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
Width="100px" Wrap="False" HorizontalAlign="Left" /><HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" Wrap="False" /></mastertableview><GroupHeaderItemStyle Wrap="False" /><clientsettings AllowColumnsReorder="True" allowdragtogroup="True"><Scrolling AllowScroll="True" UseStaticHeaders="True" /><Resizing ClipCellContentOnResize="False" ResizeGridOnColumnResize="True" /></clientsettings><ActiveItemStyle Wrap="False" /></telerik:RadGrid>
Hi all,
I have placed the grid in the my page.Enable the pagination for the grid.Set the page size is 3.Binding the records to the datagrid and these grid
contained some text boxes in the Item Template column.do some changes in the Page 1 then click on page 2 then back to the page 1.I have lost the current changes.how to avoid this problem ?
Atleast I want to show some message to user like "U lost the data"
Please help me
Regars
Sangeetha