Hi,
Where is data stored related to culture settings for radgrid. Please explain me how it works and where it is stored on client machine.
How can we cached them to use thoughout the application request.
Regards
Devanand Jha

Hi ,
I am facing one problem in IE.
I have used RadTimePicker in My Application.
<telerik:RadTimePicker ID="txtOpenTime1" runat="server" TimeView-StartTime="06:00"
TimeView-EndTime="23:30" TimeView-Interval="00:30" TimeView-TimeFormat="hh:mm tt"
TimeView-ShowFooter="true" DateInput-EmptyMessage="Open Time" Width="100px">
<TimeView RenderDirection="Vertical">
</TimeView>
</telerik:RadTimePicker>
Now When I click on Time Icon and select time from it then it returns back the value but it lost its position and scrolls back to top of Page so again I have to scroll down and select to Time and again same thing happens.
Is there any way to overcome this Problem.
Please replay ASAP.
| ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(toolbar); |
| <telerik:AjaxSetting AjaxControlID="treeview"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="toolbar" /> ... |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using Telerik.Web.UI; |
| using System.Collections; |
| using System.Configuration; |
| using System.Data; |
| using System.Web.Security; |
| using System.Text; |
| using System.Data.SqlClient; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Web.UI.HtmlControls; |
| using System.Drawing; |
| public partial class _Default : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, System.EventArgs e) |
| { |
| } |
| protected override void OnLoad(EventArgs e) |
| { |
| if (!Page.IsPostBack) |
| { |
| GetDataFromSession(); |
| } |
| else |
| { |
| GetDataFromSession(); |
| } |
| } |
| private void GetDataFromSession() |
| { |
| DataTable dtTable = new DataTable(); |
| string conn = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString(); |
| SqlDataAdapter sqladp = new SqlDataAdapter(); |
| SqlConnection sqlconn = new SqlConnection(conn); |
| sqlconn.Open(); |
| try |
| { |
| string selectQuery = "SELECT [UserID], [Username] FROM [Users] ORDER BY [Username]"; |
| sqladp.SelectCommand = new SqlCommand(selectQuery, sqlconn); |
| sqladp.Fill(dtTable); |
| RadGrid1.DataSource = dtTable; |
| RadGrid1.DataBind(); |
| } |
| finally |
| { |
| sqlconn.Close(); |
| } |
| } |
| protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e) |
| { |
| RadGrid1.DataBind(); |
| } |
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == RadGrid.PerformInsertCommandName) |
| { |
| } |
| else if (e.CommandName == RadGrid.UpdateCommandName) |
| { |
| } |
| else if (e.CommandName == RadGrid.DeleteCommandName) |
| { |
| } |
| else if (e.CommandName == RadGrid.EditCommandName) |
| { |
| } |
| } |
| protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) |
| { |
| Session.Add("UserID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["UserID"].ToString()); |
| GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn"); |
| GridEditableItem item = (GridEditableItem)e.Item; |
| RadGrid Roles = (RadGrid)item.FindControl("RadGrid2"); |
| DataTable dtTable2 = new DataTable(); |
| string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString(); |
| SqlDataAdapter sqladp2 = new SqlDataAdapter(); |
| SqlConnection sqlconn2 = new SqlConnection(conn2); |
| sqlconn2.Open(); |
| try |
| { |
| string selectQuery2 = "SELECT [RoleID],[Rolename] FROM [vw_UsersinRoles] WHERE [UserID] = " + Session["UserID"] + " ORDER BY [Username]"; |
| sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2); |
| sqladp2.Fill(dtTable2); |
| } |
| finally |
| { |
| sqlconn2.Close(); |
| } |
| Roles.DataSource = dtTable2; |
| Roles.DataBind(); |
| Roles.Visible = true; |
| } |
| } |
| protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) |
| { |
| Session.Add("RoleID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RoleID"].ToString()); |
| GridEditableItem item2 = (GridEditableItem)e.Item; |
| RadGrid Roles2 = (RadGrid)item2.FindControl("RadGrid3"); |
| GridEditCommandColumn editColumn2 = (GridEditCommandColumn)Roles2.MasterTableView.GetColumn("EditCommandColumn"); |
| DataTable dtTable2 = new DataTable(); |
| string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString(); |
| SqlDataAdapter sqladp2 = new SqlDataAdapter(); |
| SqlConnection sqlconn2 = new SqlConnection(conn2); |
| sqlconn2.Open(); |
| try |
| { |
| string selectQuery2 = "SELECT [ClassID], [Classname] FROM [vw_UsersRolesClassesFormsCombined] WHERE [UserID] = " + Session["UserID"] + " ORDER BY [Username]"; |
| sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2); |
| sqladp2.Fill(dtTable2); |
| } |
| finally |
| { |
| sqlconn2.Close(); |
| } |
| Roles2.DataSource = dtTable2; |
| Roles2.DataBind(); |
| Roles2.Visible = true; |
| } |
| } |
| protected void RadGrid3_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) |
| { |
| Session.Add("ClassID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ClassID"].ToString()); |
| GridEditableItem item3 = (GridEditableItem)e.Item; |
| RadGrid Roles3 = (RadGrid)item3.FindControl("RadGrid4"); |
| GridEditCommandColumn editColumn3 = (GridEditCommandColumn)Roles3.MasterTableView.GetColumn("EditCommandColumn"); |
| DataTable dtTable2 = new DataTable(); |
| string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString(); |
| SqlDataAdapter sqladp2 = new SqlDataAdapter(); |
| SqlConnection sqlconn2 = new SqlConnection(conn2); |
| sqlconn2.Open(); |
| try |
| { |
| string selectQuery2 = "SELECT [FormID], [Formname] FROM [vw_UsersRolesClassesFormsCombined] WHERE [UserID] = " + Session["UserID"] + " AND [ClassID] = " + Session["ClassID"] + "ORDER BY [Username]"; |
| sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2); |
| sqladp2.Fill(dtTable2); |
| } |
| finally |
| { |
| sqlconn2.Close(); |
| } |
| Roles3.DataSource = dtTable2; |
| Roles3.DataBind(); |
| Roles3.Visible = true; |
| } |
| } |
| protected void RadGrid3_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == RadGrid.PerformInsertCommandName) |
| { |
| } |
| else if (e.CommandName == RadGrid.UpdateCommandName) |
| { |
| } |
| else if (e.CommandName == RadGrid.DeleteCommandName) |
| { |
| } |
| else if (e.CommandName == RadGrid.EditCommandName) |
| { |
| } |
| } |
| protected void RadGrid4_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) |
| { |
| Session.Add("FormID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["FormID"].ToString()); |
| GridEditableItem item3 = (GridEditableItem)e.Item; |
| RadGrid Roles3 = (RadGrid)item3.FindControl("RadGrid4"); |
| GridEditCommandColumn editColumn3 = (GridEditCommandColumn)Roles3.MasterTableView.GetColumn("EditCommandColumn"); |
| DataTable dtTable2 = new DataTable(); |
| string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString(); |
| SqlDataAdapter sqladp2 = new SqlDataAdapter(); |
| SqlConnection sqlconn2 = new SqlConnection(conn2); |
| sqlconn2.Open(); |
| try |
| { |
| string selectQuery2 = "SELECT [FormID], [Formname] FROM [vw_UsersRolesClassesFormsCombined] WHERE [UserID] = " + Session["UserID"] + " AND [ClassID] = " + Session["ClassID"] + "ORDER BY [Username]"; |
| sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2); |
| sqladp2.Fill(dtTable2); |
| } |
| finally |
| { |
| sqlconn2.Close(); |
| } |
| Roles3.DataSource = dtTable2; |
| Roles3.DataBind(); |
| Roles3.Visible = true; |
| } |
| } |
| } |
| <form id="form1" runat="server"> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" |
| AllowSorting="True" GridLines="None" Width="600px" AutoGenerateColumns="false" |
| AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" |
| GroupingSettings-CaseSensitive="false" PageSize="20" EnableLinqExpressions="False" |
| OnItemDataBound="RadGrid1_ItemDataBound" ShowStatusBar="True" OnPageIndexChanged="RadGrid1_PageIndexChanged" |
| OnItemCommand="RadGrid1_ItemCommand"> |
| <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New User" |
| CommandItemDisplay="TopAndBottom" DataKeyNames="UserID"> |
| <CommandItemSettings AddNewRecordText="Add New User"></CommandItemSettings> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridEditCommandColumn HeaderStyle-Width="15px" EditText="View / Edit"> |
| <HeaderStyle Width="15px"></HeaderStyle> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridTemplateColumn UniqueName="DeleteColumn" ItemStyle-Width="16px" AllowFiltering="false"> |
| <HeaderStyle Width="16px" /> |
| <ItemTemplate> |
| <asp:ImageButton ID="imgbtnDelete" Width="14px" ToolTip="Delete Contact" runat="server" |
| CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> |
| </ItemTemplate> |
| <ItemStyle Width="16px"></ItemStyle> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="Username" HeaderText="Username" SortExpression="Username" |
| UniqueName="Username"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings CaptionFormatString="Edit details for User {0}" EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| <FormTemplate> |
| <table> |
| <tr> |
| <td> |
| <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True" |
| GridLines="None" AutoGenerateColumns="false" AllowAutomaticDeletes="True" OnItemDataBound="RadGrid2_ItemDataBound" |
| AllowAutomaticInserts="True" AllowAutomaticUpdates="True" PageSize="20" Width="500px" |
| ShowStatusBar="True"> |
| <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Role" |
| CommandItemDisplay="TopAndBottom" DataKeyNames="RoleID"> |
| <CommandItemSettings AddNewRecordText="Add New Role"></CommandItemSettings> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridEditCommandColumn HeaderStyle-Width="15px" EditText="View / Edit"> |
| <HeaderStyle Width="15px"></HeaderStyle> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridTemplateColumn UniqueName="DeleteColumn2" ItemStyle-Width="16px" AllowFiltering="false"> |
| <HeaderStyle Width="16px" /> |
| <ItemTemplate> |
| <asp:ImageButton ID="imgbtnDelete2" Width="14px" ToolTip="Delete Contact" runat="server" |
| CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> |
| </ItemTemplate> |
| <ItemStyle Width="16px"></ItemStyle> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="Rolename" HeaderText="Rolename" SortExpression="Rolename" |
| UniqueName="Rolename"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings CaptionFormatString="Edit details for User {0}" EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn2"> |
| </EditColumn> |
| <FormTemplate> |
| <table> |
| <tr> |
| <td> |
| <telerik:RadGrid ID="RadGrid3" runat="server" AllowPaging="True" |
| GridLines="None" AutoGenerateColumns="false" AllowAutomaticDeletes="True" OnItemDataBound="RadGrid3_ItemDataBound" OnItemCommand="RadGrid3_ItemCommand" |
| AllowAutomaticInserts="True" AllowAutomaticUpdates="True" GroupingSettings-CaseSensitive="false" |
| PageSize="20" EnableLinqExpressions="False" Width="400px" ShowStatusBar="True"> |
| <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Class" |
| CommandItemDisplay="TopAndBottom" > |
| <CommandItemSettings AddNewRecordText="Add New Class"></CommandItemSettings> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridEditCommandColumn HeaderStyle-Width="15px" EditText="View / Edit"> |
| <HeaderStyle Width="15px"></HeaderStyle> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridTemplateColumn UniqueName="DeleteColumn3" ItemStyle-Width="16px" AllowFiltering="false"> |
| <HeaderStyle Width="16px" /> |
| <ItemTemplate> |
| <asp:ImageButton ID="imgbtnDelete3" Width="14px" ToolTip="Delete Contact" runat="server" |
| CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> |
| </ItemTemplate> |
| <ItemStyle Width="16px"></ItemStyle> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="Classname" HeaderText="Classname" SortExpression="Classname" |
| UniqueName="Classname"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings CaptionFormatString="Edit details for User {0}" EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn3"> |
| </EditColumn> |
| <FormTemplate> |
| <table> |
| <tr> |
| <td> |
| <telerik:RadGrid ID="RadGrid4" runat="server" AllowFilteringByColumn="True" AllowPaging="True" |
| GridLines="None" AutoGenerateColumns="false" AllowAutomaticDeletes="True" OnItemDataBound="RadGrid4_ItemDataBound" |
| AllowAutomaticInserts="True" AllowAutomaticUpdates="True" GroupingSettings-CaseSensitive="false" |
| PageSize="20" EnableLinqExpressions="False" Width="300px" ShowStatusBar="True"> |
| <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Form" |
| CommandItemDisplay="TopAndBottom" DataKeyNames="FormID"> |
| <CommandItemSettings AddNewRecordText="Add New Form"></CommandItemSettings> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridTemplateColumn UniqueName="DeleteColumn4" ItemStyle-Width="16px" AllowFiltering="false"> |
| <HeaderStyle Width="16px" /> |
| <ItemTemplate> |
| <asp:ImageButton ID="imgbtnDelete4" Width="14px" ToolTip="Delete Contact" runat="server" |
| CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> |
| </ItemTemplate> |
| <ItemStyle Width="16px"></ItemStyle> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="Formname" HeaderText="Formname" SortExpression="Formname" |
| UniqueName="Formname"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <NoRecordsTemplate> |
| No Records</NoRecordsTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:Button ID="btnUpdate3" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> |
| </asp:Button> |
| <asp:Button ID="btnCancel3" Text="Cancel" runat="server" CausesValidation="False" |
| CommandName="Cancel"></asp:Button> |
| </td> |
| </tr> |
| <table> |
| </FormTemplate> |
| </EditFormSettings> |
| <NoRecordsTemplate> |
| No Records</NoRecordsTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:Button ID="btnUpdate2" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> |
| </asp:Button> |
| <asp:Button ID="btnCancel2" Text="Cancel" runat="server" CausesValidation="False" |
| CommandName="Cancel"></asp:Button> |
| </td> |
| </tr> |
| <table> |
| </FormTemplate> |
| </EditFormSettings> |
| <NoRecordsTemplate> |
| No Records</NoRecordsTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| runat="server" CommandName='<%# (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> |
| <NoRecordsTemplate> |
| No Records</NoRecordsTemplate> |
| </MasterTableView> |
| <GroupingSettings CaseSensitive="False"></GroupingSettings> |
| </telerik:RadGrid> |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| </form> |
| <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="Make,Model"> |
| <Columns> |
| <telerik:GridDropDownColumn ColumnEditorID="Make" |
| DataField="Make" |
| DataType="System.String" |
| Display="true" |
| DropDownControlType="RadComboBox" |
| HeaderText="Make" |
| ReadOnly="false" |
| SortExpression="Make" |
| UniqueName="Make"> |
| </telerik:GridDropDownColumn> |
| </Columns> |
| <EditFormSettings CaptionFormatString="Edit " |
| PopUpSettings-Modal="true" /> |
| </MasterTableView> |
| if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) |
| { |
| GridEditableItem eeditedItem = e.Item as GridEditableItem; |
| GridEditManager editMan = editedItem.EditManager; |
| GridDropDownListColumnEditor editor = editMan.GetColumnEditor("Make") as GridDropDownListColumnEditor; |
| DataTable data = new DataTable(); |
| SqlConnection conn = null; |
| conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Demo Database NAV (6-0)ConnectionString"].ConnectionString); |
| conn.Open(); |
| SqlCommand cmd = new SqlCommand("Makes", conn); |
| cmd.CommandType = CommandType.StoredProcedure; |
| cmd.Parameters.Add(new SqlParameter("@strCriteriaMake", Convert.ToString(editor.SelectedValue).ToUpper())); |
| using (SqlDataAdapter da = new SqlDataAdapter(cmd)) |
| { |
| da.Fill(data); |
| } |
| DropDownList ddList = editor.DropDownListControl; |
| for (int i = 0; i < data.Rows.Count; i++) |
| { |
| ddList.Items.Add(data.Rows[i]["Make"].ToString()); |
| } |
| ddList.DataBind(); |
| } |