<
ClientSettings>
<Scrolling AllowScroll="True" ScrollHeight="400px" UseStaticHeaders="true">
</ClientSettings>
<
asp:Button ID="btn1" runat="server" Text="Click me" OnClientClick="return Valdate();" OnClick="btn1_Click" />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
<telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="SingleExpandedItem" Width="100%" >
<Items>
<telerik:RadPanelItem Expanded="True" Value="RegistrationInformation1" style="font-weight:bold" Text="Step 1: User Information" runat="server" Selected="true">
<Items>
<telerik:RadPanelItem Value="RegistrationInformation" runat="server">
<ItemTemplate>
<asp:Table ID="tblRegistration" BackColor="#eeeeee" Width="100%" runat="server" >
</asp:Table>
<table width="100%">
<tr>
<td align="right">
<asp:Button ID="btn1" runat="server" Text="Click me" OnClientClick="return Valdate();" OnClick="btn1_Click" />
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadPanelItem>
</Items>
<CollapseAnimation Duration="100" Type="None" />
<ExpandAnimation Duration="100" Type="None" />
</telerik:RadPanelBar>
I am reffering same example .Here is following link.
| TableCell currentCell = new TableCell(); |
| RadCalendarDay day = new RadCalendarDay(RadCalendar1); |
| MonthView view = new MonthView(RadCalendar1); |
| Telerik.Web.UI.Calendar.DayRenderEventArgs e = new Telerik.Web.UI.Calendar.DayRenderEventArgs(currentCell, day,view); |
| DateTime CurrentDate = RadCalendar1.SelectedDate; |
| backgroundColor1 = Color.Red.Name; |
| backgroundColor = Color.Green.Name; |
| currentCell = e.Cell; |
| currentCell.Style["background-color"] = backgroundColor; |
| string Connection = "Data Source=62.197.41.101; Initial Catalog=PilotWebApp; User ID=sa; Pwd=medularis;"; |
| SqlConnection conn = new SqlConnection(Connection); |
| SqlCommand cmd = new SqlCommand("Slot_sp_EngineerTimeslots_Group", conn); |
| cmd.CommandType = CommandType.StoredProcedure; |
| cmd.Parameters.AddWithValue("@PROPREF", strPropref); |
| cmd.Parameters.AddWithValue("@PRIORITYCODE", PRIORITYCODE); |
| cmd.Parameters.AddWithValue("@JOBLENGTH", "30"); |
| cmd.Parameters.AddWithValue("@TIMESLOT", "AT"); |
| conn.Open(); |
| SqlDataReader reader = cmd.ExecuteReader(); |
| DataTable dt = new DataTable(); |
| dt.Load(reader); |
| DayOfMonth = DateTime.Today.Day; |
| int rows = dt.Rows.Count; |
| endDate = RadCalendar1.SelectedDate.AddDays(rows); |
| foreach (DataRow dr1 in dt.Rows) |
| { |
| startDate = DateTime.Parse(dr1["BookedDate"].ToString()); |
| if (CurrentDate >= startDate.Date && CurrentDate <= endDate.Date) |
| { |
| Label label = new Label(); |
| label.Text = e.Day.Date.Day.ToString(); |
| label.BackColor = System.Drawing.Color.Green; |
| e.Cell.Controls.Add(label); |
| // disable the selection for the specific day |
| RadCalendarDay calendarDay = new RadCalendarDay(); |
| calendarDay.Date = CurrentDate; |
| calendarDay.IsSelectable = true; |
| RadCalendar1.SpecialDays.Add(calendarDay); |
| } |
| CurrentDate.AddDays(1); |
| } |
Hey!
I have a RadGrid that performs a CallBack on Update and Insert. The Code is executed correctly and the Item is updated/inserted in my Collection but on the Client the RadGridItem stays in EditMode. I tried setting item.Edit = "false" at the end of my Insert/Update Method but this did not work and threw an exception.
I'm confused because I thought the default behaviour was for the Item to close after editing. Am I missing something in my RadGrid configuration?
| <telerik:RadGrid ID="gridVariables" runat="server" GridLines="None" AllowPaging="True" |
| AllowSorting="true" CssClass="evaluation_grid" AllowMultiRowEdit="false" |
| meta:resourcekey="gridVariables" |
| onneeddatasource="gridVariables_NeedDataSource" |
| Skin="<%# RadSkin %>" |
| onupdatecommand="gridVariables_UpdateCommand" |
| OnItemDataBound="gridVariables_ItemDataBound" |
| ondeletecommand="gridVariables_DeleteCommand" |
| oninsertcommand="gridVariables_InsertCommand" |
| oncancelcommand="gridVariables_CancelCommand" |
| AllowAutomaticUpdates="true" AllowAutomaticInserts="true" AllowAutomaticDeletes="true" |
| PageSize="10" > |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <ValidationSettings EnableValidation="false" /> |
| <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" TableLayout="Fixed" DataKeyNames="Id" ClientDataKeyNames="Id, Shortname" CommandItemDisplay="Top"> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="Id" DataField="Id" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="ShortnameColumn" DataField="Shortname" |
| meta:resourcekey="gbcShortname"> |
| <HeaderStyle Width="70px"/> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn UniqueName="NameColumn" |
| meta:resourcekey="gbcName"> |
| <ItemTemplate> |
| <p> |
| <%# Eval("Name")%> |
| </p> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:TextBox ID="txtName" Width="90%" Enabled="false" runat="server" Text='<%# Bind("Name") %>' /> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn UniqueName="DescriptionColumn" DataField="Description" |
| meta:resourcekey="gbcDescription"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="UnitColumn" DataField="Unit" |
| meta:resourcekey="gbcUnit"> |
| <HeaderStyle Width="70px"/> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn UniqueName="ChangeAttributeColumn"> |
| <HeaderStyle Width="30px"/> |
| <ItemTemplate> |
| <asp:ImageButton ID="btnChangeAttribute" runat="server" BorderWidth="1" CommandArgument='<%# Eval("Shortname") %>' ImageUrl="~/Img/change.gif" meta:resourcekey="btnChangeAttribute" OnPreRender="btnChangeAttribute_PreRender" /> |
| </ItemTemplate> |
| <EditItemTemplate> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridEditCommandColumn CancelImageUrl="~/Img/Cancel_red.gif" |
| EditImageUrl="~/Img/Edit.gif" |
| UniqueName="EditColumn" |
| UpdateImageUrl="~/Img/Update.gif" |
| ButtonType="ImageButton" |
| meta:resourcekey="vrEditColumn"> |
| <HeaderStyle Width="50px" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridButtonColumn UniqueName="DeleteColumn" CommandName="Delete" ButtonType="ImageButton"> |
| <HeaderStyle Width="30px"/> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <CommandItemTemplate> |
| <div style="padding:10px 0px;"> |
| <asp:ImageButton Text="Neu" meta:resourcekey="newValueColumn" |
| ID="btnNew" runat="server" CommandName="InitInsert" ImageAlign="Left" ImageUrl="~/Img/New.gif" |
| CausesValidation="false" OnPreRender="btnNew_PreRender" |
| Visible='<%# !gridVariables.MasterTableView.IsItemInserted %>' /> |
| <asp:LinkButton ID="btnNewVariable" CommandName="InitInsert" OnPreRender="btnNewVariable_PreRender" Visible='<%# !gridVariables.MasterTableView.IsItemInserted %>' CausesValidation="false" runat="server" Height="18px" meta:resourcekey="newValueColumn" /> |
| </div> |
| </CommandItemTemplate> |
| </MasterTableView> |
| <ClientSettings> |
| <ClientEvents OnRowDblClick="rowDoubleClick" /> |
| <Selecting AllowRowSelect="True"></Selecting> |
| </ClientSettings> |
| </telerik:RadGrid> |