| <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="GridTrial._Default" %> | |
| <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %> | |
| <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" | |
| Namespace="System.Web.UI" TagPrefix="asp" %> | |
| <!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>Untitled Page</title> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout ="3600000"></asp:ScriptManager> | |
| <div> | |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> | |
| <AjaxSettings> | |
| <telerik:AjaxSetting AjaxControlID="RADGResults"> | |
| <UpdatedControls> | |
| <telerik:AjaxUpdatedControl ControlID="RADGResults" /> | |
| </UpdatedControls> | |
| </telerik:AjaxSetting> | |
| </AjaxSettings> | |
| </telerik:RadAjaxManager> | |
| <telerik:RadGrid ID="RADGResults" MasterTableView-Width="100%" runat="server" Skin="NCCI" | |
| AllowSorting="false" EnableEmbeddedSkins="false" AllowMultiRowSelection="true" | |
| AllowMultiRowEdit="true" AutoGenerateColumns="false" | |
| GridLines="None" > | |
| <ClientSettings> | |
| <Selecting AllowRowSelect="True" EnableDragToSelectRows="false"/> | |
| <Scrolling AllowScroll="True" /> | |
| </ClientSettings> | |
| <SelectedItemStyle BackColor="gray" /> | |
| <MasterTableView EditMode="InPlace" CommandItemDisplay="top" > | |
| <ItemStyle CssClass="MainTableEvenColumnCorp"/> | |
| <HeaderStyle CssClass="ms-formlabel MainTableHeaderCORP" Font-Size="x-Small"></HeaderStyle> | |
| <AlternatingitemStyle CssClass="MainTableOddColumnCorp"/> | |
| <Columns> | |
| <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ItemStyle-ForeColor="beige"/> | |
| <telerik:GridTemplateColumn HeaderText="Report Number" UniqueName="ReportNumber"> | |
| <ItemStyle HorizontalAlign="Center" /> | |
| <HeaderStyle HorizontalAlign="Center" /> | |
| <ItemTemplate> | |
| <asp:Label id="txtReport" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.Report_Number") %>'></asp:Label> | |
| </ItemTemplate> | |
| <EditItemTemplate> | |
| <asp:Label id="txtReport" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.Report_Number") %>'></asp:Label> | |
| <asp:DropDownList id="ddlReport" runat="server" DataTextField="Report_Number" visible="false" > | |
| <asp:ListItem Value='1' ></asp:ListItem> | |
| <asp:ListItem Value='2' ></asp:ListItem> | |
| <asp:ListItem Value='3' ></asp:ListItem> | |
| <asp:ListItem Value='4' ></asp:ListItem> | |
| <asp:ListItem Value='5' ></asp:ListItem> | |
| </asp:DropDownList> | |
| </EditItemTemplate> | |
| </telerik:GridTemplateColumn> | |
| <telerik:GridBoundColumn DataField ="Number Of Risks" HeaderText ="Number Of Risks" UniqueName="NumberOfRisks" > | |
| <ItemStyle HorizontalAlign="Center" /> | |
| <HeaderStyle HorizontalAlign="Center" /> | |
| </telerik:GridBoundColumn> | |
| </telerik:GridTemplateColumn> | |
| </Columns > | |
| <CommandItemStyle HorizontalAlign="Center" /> | |
| <CommandItemTemplate> | |
| <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RADGResults.EditIndexes.Count > 0 %>'><img style="border:0px" alt="" src="../media/Update.gif" /> Update Customers</asp:LinkButton> | |
| <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RADGResults.EditIndexes.Count > 0 or RADGResults.MasterTableView.IsItemInserted %>'><img style="border:0px" alt="" src="../media/Cancel.gif" /> Cancel editing</asp:LinkButton> | |
| <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# not RADGResults.MasterTableView.IsItemInserted %>'><img style="border:0px" alt="" src="../media/AddRecord.gif" /> Add new Customer</asp:LinkButton> | |
| <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RADGResults.MasterTableView.IsItemInserted %>'><img style="border:0px" alt="" src="../media/AddRecord.gif" /> Add this Customer</asp:LinkButton> | |
| <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')" | |
| runat= "server" CommandName="DeleteSelected"><img style="border:0px" alt="" src="../media/Delete.gif" /> Delete Selected Customers</asp:LinkButton> | |
| <asp:LinkButton ID="LinkButton4" runat="server" CommandName="Re bindGrid"><img style="border:0px" alt="" src="../media/Refresh.gif" /> Refresh customer list</asp:LinkButton> | |
| <br/> | |
| </CommandItemTemplate> | |
| </MasterTableView> | |
| </telerik:RadGrid> | |
| </div> | |
| </form> | |
| </body> | |
| </html> | |
| In the code behind | |
| Partial Public Class _Default | |
| Inherits System.Web.UI.Page | |
| Public DBGrid As New GridBind | |
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | |
| ' changes grid into inline edit mode without rebind | |
| Dim i As Integer | |
| For i = 0 To RADGResults.PageSize - 1 | |
| RADGResults.EditIndexes.Add(i) | |
| Next i | |
| End Sub | |
| Private Sub RADGResults_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RADGResults.NeedDataSource | |
| RADGResults.DataSource = Me.GridSource | |
| End Sub | |
| Private ReadOnly Property GridSource() As DataTable
Get Else Dim table As New DataTable() End Get Protected Function loadgrid() As DataTable Dim dt As New DataTable |
|
| Private Sub RADGResults_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RADGResults.UpdateCommand | |
| 'gridclientselectcolumn selected for multiple updates | |
| For Each dataitem As Telerik.Web.UI.GridEditableItem In RADGResults.SelectedItems | |
| ' For Each dataitem As Telerik.Web.UI.GridDataItem In RADGResults.MasterTableView.Items | |
| ' For Each dataitem As Telerik.Web.UI.GridEditableItem In RADGResults.MasterTableView.Items 'even tried Editable Item | |
| Dim strsql As String | |
| 'the grid.datasource is now nothing | |
| strsql = dataitem("Report_Number").Text 'cannot retrieve any edittemplate/itemtemplate/boundcolumn values | |
| Next | |
| End Sub | |
| Private Sub RADGResults_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RADGResults.InsertCommand | |
| Dim insertedItem As Telerik.Web.UI.GridEditFormInsertItem = DirectCast(e.Item, Telerik.Web.UI.GridEditFormInsertItem) | |
| 'the grid.datasource is now nothing | |
| Dim risk As String = (TryCast(insertedItem("Report_Number").Controls(0), TextBox)).Text 'cannot retrieve the inserted edittemplate/itemtemplate/boundcolumn values | |
| End Sub | |
| End Class | |
Hi
I am facing a problem in telerik grid.
I have used BoundColumns as well as Template Columns like RadComboBox and MaskedTextBox in my Grid.
<
telerik:GridBoundColumn DataField="TimesheetDate" HeaderText="Timesheet Date" UniqueName="TimesheetDate" HeaderStyle-Width="20%">
<HeaderStyle Width="20%"></HeaderStyle></telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Location" HeaderStyle-Width="30%" UniqueName="Location"><ItemTemplate>
<telerik:RadComboBox ID="RadComboBox6" Runat="server" CssClass="bodytxt" DataTextField="desc" DataValueField="Id" MarkFirstMatch="True" Skin="Web20" ToolTip="Select a recipient" Width="200px" DataSourceID="sqlLocations" Font-Size="10pt">
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</ItemTemplate>
<HeaderStyle Width="30%"></HeaderStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Time In" HeaderStyle-Width="15%" UniqueName="TimeIn">
<ItemTemplate>
<asp:TextBox ID="txtTimeIn" runat="server" Width="75px" CssClass="textfields"></asp:TextBox> </ItemTemplate>
<HeaderStyle Width="15%"></HeaderStyle>
</telerik:GridTemplateColumn>
I am accessing the values of Bound Columns like this:
foreach (GridDataItem item in RadGrid1.MasterTableView.GetItems(new GridItemType[] {GridItemType.Item, GridItemType.AlternatingItem }))
{
GridDataItem dataitem = (GridDataItem)item;
TableCell cell = dataitem["TimesheetDate"];
TextBox tBox = (TextBox)cell.FindControl("TimesheetDate");
DateTime timesheetDate = Convert.ToDateTime(dataitem["TimesheetDate"].Text);
}
The Problem is:
When i try to access the value in the Template column while using the same method, I am getting a 'null' in the Text property.
Please note that i am accessing the values in <ItemTemplate> not in "<EditItemTemplate>"
Good morning Telerik Community,
I am having a problem with Rad Tool Tip.
The tool tip that I am using:
- Is dimensioned to be 900px (wide), 300px (tall)
- Slides up from the bottom center
- contains a custom control that displays bounded data.
Symptom:
- The 900px * 300px “Telerik Tool Tip Box” loads fine, but for a few seconds the custom control loads outside to the bottom left of the “Telerik Tool Tip Box” and then “snaps inside the box" it when it is done loading. This is a problem.
- This only seems to happen if the Tool tip for that item has already been displayed. Meaning I click on an Item1, ToolTip1 pops up. Then click on Item2, and then back to Item1 again (ToolTip1 pops up again, but now with that above error).
(Could be a caching problem?)
Truly stumped,
Regards,
-matthew
When this scenario occurs, I am setting the calendar.MultiViewRows = 2, but that does nothing. Ideally, I'd like to show only a single month view when all the special days fall in the same month, but show 2 months when the starting special day and the ending special day are different. Your help will be greatly appreciated.
<
httpHandlers>
<
remove path="*.asmx" verb="*"/>
<
add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<
add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<
add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<
add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.1.415.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
<
add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2008.1.415.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
<
add path="Telerik.RadUploadProgressHandler.aspx" verb="*" type="Telerik.WebControls.RadUploadProgressHandler, RadUpload.Net2, Version=2008.1.415.20, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</
httpHandlers>
<
httpModules>
<
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<
add name="RadUploadModule" type="Telerik.WebControls.RadUploadHttpModule, RadUpload.Net2, Version=2008.1.415.20, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</
httpModules>
Could some one please point me in the right direction as to what the text should