CheckBoxes="true" TriStateCheckBoxes="true"
CheckChildNodes="true"
If a Node is Checked and then I expand it, the node's image turns to [unchecked] but javascript does return get_checked() = true. Is this a bug?
I have a new record (an HTML ASP.NET form) and and edit records (an ASP.NET FormView).
I use the date picker in both. Whe nI create a new record, the data is saved fine.
When I open the FormView to edit, the proper date is bound and pre-loaded into the RAD date picker.
When I change the data in the edit form and submit, the date does not change. All other fields in the form view update correctly, so I do not think the events are not firing.
Here is the HTML"
<asp:FormView ID="FormView1" runat="server" Caption="Company Details"
CssClass="dataTable" DataKeyNames="Id" DataSourceID="LinqDataSource1"
DefaultMode="Edit" onitemcommand="FormView1_ItemCommand"
onitemupdated="FormView1_ItemUpdated">
<RowStyle CssClass="rowa" />
<EditItemTemplate>
<table cellpadding="0" cellspacing="0" class="style1">
// CLIPPED FOR READABILITY
<tr>
<td>
URL:
</td>
<td>
<asp:TextBox ID="URLTextBox" runat="server" CssClass="textBox"
Text='<%# Bind("URL") %>' Width="200px" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:CheckBox ID="IsActiveCheckBox" runat="server"
Checked='<%# Bind("IsActive") %>' Text="Is Active?" />
<asp:CheckBox ID="IsQIBCheckBox" runat="server" Checked='<%# Bind("IsQIB") %>'
Text="Is QIB?" />
</td>
</tr>
<tr>
<td>
QIB Exp Date:
</td>
<td>
<radCln:RadDatePicker ID="txtQibDate" Runat="server"
Culture="English (United States)" EnableTyping="False"
DbSelectedDate='<%# Bind("QIB_Exp_Date") %>'>
<DateInput Skin="">
</DateInput>
</radCln:RadDatePicker>
</td>
</tr>
</table>
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" CssClass="linkButton" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" CssClass="linkButton"
Text="Cancel" />
</EditItemTemplate>
Thanks.
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CreateIDR.aspx.cs" Inherits="POPS.State.DHH.IDR.CreateIDR" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!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 id="Head1" runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="ScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <!-- content start --> |
| <div style="height: 100%; padding: 10px"> |
| <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" /> |
| <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" /> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| GridLines="None" AllowPaging="True" AllowSorting="True" |
| AutoGenerateColumns="False" |
| Width="97%" |
| OnNeedDataSource="RadGrid1_NeedDataSource" |
| OnDeleteCommand="RadGrid1_DeleteCommand" |
| OnInsertCommand="RadGrid1_InsertCommand" |
| OnUpdateCommand="RadGrid1_UpdateCommand" |
| OnPreRender="RadGrid1_PreRender" |
| OnItemCommand="RadGrid1_ItemCommand" |
| OnItemCreated="RadGrid1_ItemCreated" |
| OnColumnCreated="RadGrid1_ColumnCreated" |
| AllowFilteringByColumn="True"> |
| <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> |
| <MasterTableView DataKeyNames="IDR_ID" GridLines="None" Width="100%" CommandItemDisplay ="Top" > |
| <Columns> |
| <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete"> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="IDR_ID" HeaderText="IDRID" UniqueName="IDR_ID" ReadOnly="True"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="REQUESTOR_TITLE" HeaderText="Requestor Title" UniqueName="IDR_TYPE"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="REQUESTOR_FIRST_NAME" HeaderText="Requestor First Name" UniqueName="IDR_SUBTYPE"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="REQUESTOR_LAST_NAME" HeaderText="Requestor Last Name" UniqueName="REQUESTED_BY"> |
| </telerik:GridBoundColumn> |
| <telerik:GridEditCommandColumn> |
| </telerik:GridEditCommandColumn> |
| </Columns> |
| <EditFormSettings UserControlName="IDRInsertFormUserControl.ascx" EditFormType="WebUserControl"> |
| <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> |
| </EditColumn> |
| </EditFormSettings> |
| <ExpandCollapseColumn Visible="False"> |
| <HeaderStyle Width="19px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <telerik:RadSplitter ID="RadSplitter1" runat="server" skin="Office2007"> |
| <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> |
| <telerik:RadPane ID="RadPane1" runat="server"> |
| /////Here the edit form should show ////////////////////// |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| </div> |
| </form> |
| </body> |
| </html> |
I having problems getting my Master/Detail grids to work. I have a page with two separate grids. Grid1 is the master and uses NeedDataSource to get it's data. Grid2 is the detail grid and will also use the NeedDataSource to get its data. Similar to this example:http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx. However, the example doesn't use NeedDataSource it uses client side declared datasources.
Grid1 (Master) is working fine(Retrieve data / Add/Update/Delete). But I'm not sure how to connect the Master grid to the Detail. I have turned on postbackonrowclick in Grid1. I was thinking I could call Grid2.Rebind() (Detail) in Grid1_NeedDataSource (Master) and pick up the Grid1.SelectedValue (Master's selected value) in Grid2_NeedDataSource (Detail) and pass it to my datalayer and everything will be good. But this doesn't work. I'm getting an object reference not found on Grid1.SelectedValue on page load. I'm guessing that's because nothing is selected on page load. ( I figured if nothing was selected it would return 0). What's the best way to get this to work??
Grids:
| <telerik:RadGrid ID="Grid1" runat="server" Width="95%" GridLines="None" |
| AutoGenerateColumns="False" PageSize="13" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="false" AllowMultiRowEdit="false" |
| OnUpdateCommand="ULNGrid_UpdateCommand" OnNeedDataSource="ULNGrid_NeedDataSource" OnItemDataBound="ULNGrid_ItemDataBound" |
| ShowStatusBar="true" ShowGroupPanel="false" OnInsertCommand="ULNGrid_InsertCommand" OnDeleteCommand="ULNGrid_DeleteCommand" Skin="Outlook" Visible="true" > |
| <MasterTableView DataKeyNames="Userlistnameid" Width="100%" CommandItemDisplay="TopAndBottom" EditMode="InPlace"> |
| <Columns> |
| <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" /> |
| <telerik:GridBoundColumn DataField="Name" HeaderText="Name" MaxLength="200" UniqueName="Name"> |
| <ItemStyle Width="400px" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridDropDownColumn HeaderText="User List Type" UniqueName="UserListTypeddl" ListTextField="Name" ListValueField="Userlisttypeid" DataField="Userlisttypeid" |
| SortExpression="Userlisttypeid" DropDownControlType="DropDownList" FooterText="RadComboBox column footer" DataSourceID="SqlDsUserListTypeIdAll"> |
| </telerik:GridDropDownColumn> |
| <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel" EditText="Edit"> |
| <HeaderStyle Width="85px"></HeaderStyle> |
| </telerik:GridEditCommandColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings EnablePostBackOnRowClick="true" > |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| //****************************************************************************** |
| <telerik:RadGrid ID="Grid2" runat="server" Width="95%" GridLines="None" |
| AutoGenerateColumns="False" PageSize="13" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="false" AllowMultiRowEdit="false" |
| OnUpdateCommand="ULCGrid_UpdateCommand" OnNeedDataSource="ULCGrid_NeedDataSource" OnItemDataBound="ULCGrid_ItemDataBound" |
| ShowStatusBar="true" ShowGroupPanel="false" OnInsertCommand="ULCGrid_InsertCommand" OnDeleteCommand="ULCGrid_DeleteCommand" Skin="Outlook" Visible="true" > |
| <MasterTableView DataKeyNames="Userlistcodeid" Width="100%" CommandItemDisplay="TopAndBottom" EditMode="InPlace"> |
| <Columns> |
| <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" /> |
| <telerik:GridBoundColumn DataField="Code" HeaderText="Code" MaxLength="32" UniqueName="Code"> |
| <ItemStyle Width="400px" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel" EditText="Edit"> |
| <HeaderStyle Width="85px"></HeaderStyle> |
| </telerik:GridEditCommandColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings > |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
Code:
| Grid1: |
| public List<UserListName> GetULNList() |
| { |
| List<UserListName> ulnlist = UserListName.getAll(); |
| return ulnlist; |
| } |
| protected void Grid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| Grid1.DataSource = GetULNList(); |
| Grid2.Rebind() |
| } |
| //******************************************************************************* |
| public List<UserListCode> GetULCList() |
| { |
| string strulnid = Grid1.SelectedValue.ToString(); |
| int ulnid = 0; |
| Int32.TryParse(strulnid, out ulnid); |
| List<UserListCode> ulclist = UserListCode.getbyKey(ulnid); |
| return ulclist; |
| } |
| protected void Grid2_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| Grid2.DataSource = GetULCList(); |
| } |
Thanks
I am using a grid control with a user control for editing the data. The Grid also allows multi editing and is using Paging.
I want to automatically save any changes that are in my edit control when someone navigates off the page or causes a postback. Here is the code I am using to gain access to my control for saving, but it always returns “Nothing.”
VB Code To Get Handle to UserControl:
| For Each gi As GridEditableItem In dgIVG.EditItems |
| Dim MyUserControl As PatientDetails = CType(gi.FindControl("ctrlPatientDetails"), PatientDetails) |
| If MyUserControl IsNot Nothing Then |
| If Not MyUserControl.SaveData() Then |
| MyUserControl.MessageErrorVisible = True |
| Exit Sub |
| End If |
| End If |
| Next |
ASPX Code
| <telerik:RadGrid id="dgIVG" runat="server" Width="750px" AllowPaging="false" GridLines="None" AllowMultiRowEdit="false" Visible="false" Skin="Web20" > |
| <MasterTableView AutoGenerateColumns="False" NoMasterRecordsText="There are no patients that match the filter criteria." DataKeyNames="ID" > |
| <AlternatingItemStyle HorizontalAlign="Left" /> |
| <HeaderStyle BackColor="#5d7b9d" ForeColor="White" /> |
| <ItemStyle HorizontalAlign="Left" /> |
| <Columns> |
| <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="View" /> |
| <telerik:GridTemplateColumn HeaderText="" Visible="false"> |
| <ItemTemplate> |
| <asp:Label id="lblAppointmentID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ID") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Med Rec #"> |
| <ItemTemplate> |
| <asp:Label id="lblMedRecNo" runat="server" Width="80px" Text='<%#DataBinder.Eval(Container, "DataItem.MedRecNo") %>'></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <uc4:PatientDetails ID="ctrlPatientDetails" runat="server" |
| AppointmentID='<%# DataBinder.Eval(Container, "DataItem.ID") %>' |
| /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Patient Name"> |
| <ItemTemplate> |
| <asp:Label id="lblPtName" runat="server" Width="150px" Text='<%# DataBinder.Eval(Container, "DataItem.PtName") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Appt Date"> |
| <ItemTemplate> |
| <asp:Label id="lblApptDate" runat="server" Width="80px" Text='<%# DateTime.Parse(DataBinder.Eval(Container, "DataItem.ApptDate")).ToShortDateString %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Original Verification Result"> |
| <ItemTemplate> |
| <asp:Label id="lblOrigVerificationResult" runat="server" Width="150px" Text='<%# GetFriendlyOrigVerificationResult(DataBinder.Eval(Container, "DataItem.OrigVerificationResult")) %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Location"> |
| <ItemTemplate> |
| <asp:Label id="lblLocation" runat="server" Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem.Location") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Insurance Plan"> |
| <ItemTemplate> |
| <asp:Label id="lblInsPlan" runat="server" Width="100px" Text='<%# GetFriendlyInsurancePlan(DataBinder.Eval(Container, "DataItem.InsPlan")) %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
Is there something I’m missing?
Thanks,
Don Tompkins