or
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AllowMultiRowEdit="True" DataKeyNames="TradeBreakTxnID" DataSourceID="SqlDataSource2" GridLines="Vertical" Skin="Black" Height="500px" onneeddatasource="RadGrid1_NeedDataSource" Width="1186px" Visible="False" onItemDataBound="Data_OnItemDataBound" AllowMultiRowSelection="True" Font-Names="Times New Roman" HorizontalAlign="Center"> <clientsettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"> <Selecting AllowRowSelect="True" /><Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> <resizing allowcolumnresize="True" /> </clientsettings><ClientSettings> <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" /><Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling><Resizing AllowColumnResize="True"></Resizing> </ClientSettings><MasterTableView datasourceid="SqlDataSource2" CommandItemDisplay="Top" EditMode="InPlace" AllowAutomaticUpdates="True" AllowAutomaticDeletes="true" DataKeyNames="TradeBreakTxnID"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <Columns> <telerik:GridBoundColumn DataField="TradeBreakTxnID" HeaderText="TradeBreakTxnID" ReadOnly="true" SortExpression="TradeBreakTxnID" UniqueName="TradeBreakTxnID" HeaderStyle-Width="30px" Visible="true" DataType="System.Int32" > <HeaderStyle Width="30px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Manager" HeaderText="Manager" SortExpression="Manager" UniqueName="Manager" ReadOnly="True" HeaderStyle-Width="100px"> <HeaderStyle Width="100px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Product" HeaderText="Product" SortExpression="Product" UniqueName="Product" ReadOnly="True" HeaderStyle-Width="90px" > <HeaderStyle Width="90px"></HeaderStyle> </telerik:GridBoundColumn> <%-- <telerik:GridBoundColumn DataField="AccountNo" ReadOnly="True" HeaderText="AccountNo" SortExpression="AccountNo" UniqueName="AccountNo" HeaderStyle-Width="130px"> </telerik:GridBoundColumn>--%> <telerik:GridBoundColumn DataField="Account" HeaderText="Account" SortExpression="Account" ReadOnly="True" UniqueName="Account" HeaderStyle-Width="60px"> <HeaderStyle Width="60px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Price" DataType="System.Decimal" ReadOnly="True" HeaderText="Price" SortExpression="Price" UniqueName="Price" HeaderStyle-Width="60px"> <HeaderStyle Width="60px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="TradeDate" ReadOnly="True" HeaderText="TradeDate" SortExpression="TradeDate" HeaderStyle-Width="85px" UniqueName="TradeDate"> <HeaderStyle Width="85px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ContractDate" HeaderText="Contract<br/>Date" ReadOnly="True" SortExpression="ContractDate" UniqueName="ContractDate" HeaderStyle-Width="50px" DataType="System.Int32"> <HeaderStyle Width="50px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="B/S" HeaderText="B/S" ReadOnly="True" SortExpression="B/S" UniqueName="B/S" HeaderStyle-Width="25px"> <HeaderStyle Width="25px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FCM Quantity" ReadOnly="True" HeaderText="FCM Quantity" SortExpression="FCM Quantity" HeaderStyle-Width="50px" UniqueName="FCM Quantity" > <HeaderStyle Width="50px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Manager Quantity" HeaderText="Manager Quantity" ReadOnly="True" SortExpression="Manager Quantity" UniqueName="Manager Quantity" HeaderStyle-Width="60px"> <HeaderStyle Width="60px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Difference" HeaderText="Difference" SortExpression="Difference" UniqueName="Difference" ReadOnly="True" HeaderStyle-Width="65px"> <HeaderStyle Width="65px"></HeaderStyle> </telerik:GridBoundColumn> <%-- <telerik:GridTemplateColumn UniqueName="MatchEdit" HeaderText="MatchEdit" HeaderStyle-Width="30px"> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" checked="false" OnCheckedChanged="CheckBox1_CheckedChanged" /> </ItemTemplate> </telerik:GridTemplateColumn> --%> <telerik:GridDropDownColumn DataField="MatchType" HeaderText="Match<br/>Type" ReadOnly="False" HeaderStyle-Width="80px" SortExpression="MatchType" UniqueName="MatchType" DataSourceID="DropDownList2_DataSource" ListTextField="MatchType" ListValueField="MatchType"> <HeaderStyle Width="80px"></HeaderStyle> </telerik:GridDropDownColumn> <telerik:GridBoundColumn DataField="Comment" HeaderStyle-Width="200px" HeaderText="Comment" ReadOnly="false" SortExpression="Comment" UniqueName="Comment" Visible="true"> <HeaderStyle Width="200px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Note" HeaderText="Note" HeaderStyle-Width="100px" ReadOnly="True" SortExpression="Note" UniqueName="Note" Visible="false"><HeaderStyle Width="100px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="UpdateDttm" HeaderText="UpdateDttm" HeaderStyle-Width="150px" ReadOnly="True" SortExpression="UpdateDttm" UniqueName="UpdateDttm" DataType="System.DateTime" Visible="true"> <HeaderStyle Width="150px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="UpdateUser" HeaderText="UpdateUser" HeaderStyle-Width="210px" ReadOnly="True" SortExpression="UpdateUser" UniqueName="UpdateUser" Visible="true" ><HeaderStyle Width="210px"></HeaderStyle> </telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="FileName" HeaderText="FileName" HeaderStyle-Width="250px" ReadOnly="False" SortExpression="FileName" UniqueName="FileName"> <ItemTemplate> <asp:LinkButton ID="LinkButton2" runat="server" OnClick="Retreive_Doc" Text='<%# Bind("FileName") %>'></asp:LinkButton> </ItemTemplate> <EditItemTemplate> <telerik:RadUpload ID="RadUpload2" runat="server" Skin="Outlook" ControlObjectsVisibility="None" MaxFileInputsCount="1" ReadOnlyFileInputs="true" ></telerik:RadUpload> <asp:Button ID="InsertDoc" runat="server" OnClick="InsertDoc_Click" Text="Add" BackColor="#000" ForeColor="White" Width="60px"/> <asp:Button ID="Button1" runat="server" OnClick="Delete_Click" Text="Delete" BackColor="#000" ForeColor="White" Width="60px"/> </EditItemTemplate> <HeaderStyle Width="210px"></HeaderStyle> </telerik:GridTemplateColumn> </Columns> <CommandItemTemplate> <div style="padding: 5px 5px;background-color:#000000"> <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="/TradeBreak/images/Edit.gif" />Edit selected</asp:LinkButton> <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="/TradeBreak/images/Update.gif" />Update</asp:LinkButton> <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="/TradeBreak/images/Cancel.gif" />Cancel editing</asp:LinkButton> <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete selected Trade?')" runat= "server" CommandName="DeleteSelected"><img style="border:0px" alt="" src="/TradeBreak/images/Delete.gif" /> Delete Trade</asp:LinkButton> <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="/TradeBreak/images/Refresh.gif" />Refresh</asp:LinkButton> </div> </CommandItemTemplate> <EditFormSettings><EditColumn UniqueName="EditCommandColumn1"></EditColumn></EditFormSettings></MasterTableView> <HeaderStyle Font-Bold="True" HorizontalAlign="Center" /> <SelectedItemStyle BackColor="Black" /> </telerik:RadGrid>div#tablaThe rad grid is placed inside a div with the table id, and when i press to filter a column the options are misplaced and some dont even show
{
/*height:1024PX; */
background-color:white;
/*border: 12px solid #2e2e2e;*/
color:Black;
margin-top: 25px;
margin-bottom: 25px;
margin-left: auto;
margin-right: auto;
overflow:hidden;
padding: 0px;
position:relative;
width:960px;
}
private void InsertLocations() { Telerik.Web.UI.GridItemCollection gic = this.RadGrid2.SelectedItems; foreach (Telerik.Web.UI.GridItem gi in gic) { string location = DataBinder.Eval(gi.DataItem, "Location").ToString(); } }function tsCoding_OnClientTabSelected(sender, args) {
var tab = args.get_tab();
if (tab.get_tabs().get_count() != 0) {
tab.get_tabs().getTab(0).enable();
tab.get_tabs().getTab(0).select();
}
}
<%@ Page Language="C#" MasterPageFile="~/MasterPageDialogs.master" AutoEventWireup="true" CodeFile="Photos.aspx.cs" Inherits="Dialogs_Photos" %> <%@ MasterType VirtualPath="~/MasterPageDialogs.master" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" Runat="Server"> <link href="../Rotator.css" rel="stylesheet" type="text/css" /> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentBody" Runat="Server"> <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"></telerik:RadAjaxManagerProxy> <script type="text/javascript"> function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well) return oWindow; } function CloseOnReload() { GetRadWindow().VisibleOnPageLoad = false; GetRadWindow().close(); } function RefreshParentPage() { GetRadWindow().BrowserWindow.location.href = GetRadWindow().BrowserWindow.location.href; } </script> <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="thumbRotator"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="imgPhoto" /> <telerik:AjaxUpdatedControl ControlID="detailsPanel" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="ibtnSavePhoto"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="ibtnSavePhoto" /> <telerik:AjaxUpdatedControl ControlID="thumbRotator" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="ibtnDeletePhoto"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="ibtnDeletePhoto" /> <telerik:AjaxUpdatedControl ControlID="thumbRotator" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManagerProxy> <asp:Label ID="lblPhotoType" runat="server" Text="" style="display:none"></asp:Label> <asp:Label ID="lblPhotoKey" runat="server" Text="" style="display:none"></asp:Label> <asp:Label ID="lblPhotoSubKey" runat="server" Text="" style="display:none"></asp:Label> <table width="743" cellpadding="0" cellspacing="0" border="0"> <tr> <td style="height: 22px"> <img src="../Images/Rotator/white.gif" height="22" width="60" alt="" style="float: left;" /></td> <td style="height: 22px"> <img src="../Images/Rotator/cornerLeftTop.gif" height="22" width="50" alt="" style="float: left;" /></td> <td style="height: 22px"> <img src="../Images/Rotator/topLeft.gif" height="22" width="292" alt="" style="float: left;" /></td> <td style="height: 22px"> <img src="../Images/Rotator/topRight.gif" height="22" width="280" alt="" style="float: left;" /></td> <td style="height: 22px"> <img src="../Images/Rotator/cornerRightTop.gif" height="22" width="62" alt="" style="float: left;" /></td> </tr> <tr> <td> <img src="../Images/Rotator/whiteMiddle.gif" height="243" width="60" alt="" style="float: left;" /></td> <td> <img src="../Images/Rotator/leftFrame.gif" height="243" width="50" alt="" style="float: left;" /></td> <td class="previewPane"> <div style="margin-top: 20px"> <telerik:RadBinaryImage ID="imgPhoto" runat="server" Height="192" Width="192" ResizeMode="Fit" ImageAlign="Middle" /> </div> </td> <td class="infoPane"> <div class="infoPaneBg" runat="server" id="detailsPanel"> <div class="imageDetailsHeader"> <table width="100%"> <tr> <td width="70%"> Image details: </td> <td width="15%" align="center"> <asp:ImageButton ID="ibtnSavePhoto" runat="server" ImageUrl="~/Images/Save.png" onclick="ibtnSavePhoto_Click" /> </td> <td width="15%" align="center"> <asp:ImageButton ID="ibtnDeletePhoto" runat="server" ImageUrl="~/Images/Delete.png" onclick="ibtnDeletePhoto_Click" /> </td> </tr> </table> </div> <div id="viewPanel"> <div class="details"> <strong>Title:</strong> <asp:Label ID="lblPhotoID" runat="server" Text="" style="display:none"></asp:Label> <asp:TextBox ID="txtPhotoTitle" runat="server" Text=""></asp:TextBox> </div> <div class="details"> <strong>Description:</strong> <asp:TextBox ID="txtPhotoDescription" runat="server" Text=""></asp:TextBox> </div> <div class="details"> </div> <div class="details" style="margin-top: 5px; margin-left: 28px"> </div> </div> </div> </td> <td> <img src="../Images/Rotator/rightFrame.gif" height="243" width="62" alt="" style="float: left;" /></td> </tr> <tr> <td> <img src="../Images/Rotator/whiteShadow.gif" height="117" width="60" alt="" /></td> <td> <img src="../Images/Rotator/left.gif" id="img_left" height="117" width="50" alt="" style="cursor: pointer" /></td> <td colspan="2" class="thumbsViewer"> <telerik:RadRotator ID="thumbRotator" runat="server" RotatorType="ButtonsOver" Width="572" Height="118px" ItemHeight="118" ItemWidth="145" FrameDuration="1" ScrollDirection="Left,Right" DataSourceID="dsThumbnails" OnItemClick="ShowImage"> <ItemTemplate> <div class="itemTemplate"> <asp:Label runat="server" ID="lblPhotoID" Text='<%# Eval("PhotoID") %>' style="display:none"></asp:Label> <asp:Label runat="server" ID="lblTitle" Text='<%# Eval("Title") %>' style="display:none"></asp:Label> <asp:Label runat="server" ID="lblDescription" Text='<%# Eval("Description") %>' style="display:none"></asp:Label> <telerik:RadBinaryImage ID="imgHiddenPhoto" runat="server" DataValue='<%# Eval("PhotoFile") %>' style="display:none"/> <telerik:RadBinaryImage ID="imgThumbnail" runat="server" DataValue='<%# Eval("Thumbnail") %>' Height="118px" Width="118px" ResizeMode="Fit" CssClass="RotatorImage" AlternateText='<%# Eval("Title") %>' ToolTip='<%# Eval("Title") %>' /> </div> </ItemTemplate> <ControlButtons LeftButtonID="img_left" RightButtonID="img_right" /> </telerik:RadRotator> </td> <td> <img src="../Images/Rotator/right.gif" id="img_right" height="117" width="62" alt="" style="cursor: pointer" /></td> </tr> </table> <asp:SqlDataSource ID="dsThumbnails" runat="server" ConnectionString="<%$ ConnectionStrings:EventMgmtCSDev %>" SelectCommand="SELECT [PhotoID], [Thumbnail], [PhotoFile], [Title], [Description] FROM [Photos] WHERE (([PhotoKey] = @PhotoKey) AND ([PhotoType] = @PhotoType) AND ([PhotoSubKey] = @PhotoSubKey))"> <SelectParameters> <asp:ControlParameter ControlID="lblPhotoKey" Name="PhotoKey" PropertyName="Text" Type="Int64" /> <asp:ControlParameter ControlID="lblPhotoType" Name="PhotoType" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="lblPhotoSubKey" Name="PhotoSubKey" PropertyName="Text" Type="Int64" /> </SelectParameters> </asp:SqlDataSource> <br /> <asp:Button ID="btnUploadPhotos" runat="server" Text="Upload Photos"/> <telerik:RadToolTip ID="ToolTipAddQuote" runat="server" Width="300px" Height="300px" TargetControlID="btnUploadPhotos" Position="Center" RelativeTo="BrowserWindow" HideEvent="ManualClose" ShowEvent="OnClick" Animation="Slide" AnimationDuration="1000"> <telerik:RadProgressManager runat="server" ID="RadProgressManager1" /> <table width="90%"> <tr> <td> <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MultipleFileSelection="Automatic" TemporaryFileExpiration="0:15:00"> </telerik:RadAsyncUpload> </td> <td align="right"> <asp:Button ID="btnUpload" runat="server" Text="Upload Selected Files" onclick="btnUpload_Click" /> </td> </tr> </table> <telerik:RadProgressArea runat="server" ID="RadProgressArea1"> </telerik:RadProgressArea> </telerik:RadToolTip> </asp:Content> using System; using System.Data; using System.Data.SqlClient; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Telerik.Web.UI; public partial class Dialogs_Photos : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblPhotoType.Text = HttpContext.Current.Request.QueryString["PhotoType"]; lblPhotoKey.Text = HttpContext.Current.Request.QueryString["PhotoKey"]; lblPhotoSubKey.Text = HttpContext.Current.Request.QueryString["PhotoSubKey"]; } } protected void ShowImage(object sender, RadRotatorEventArgs e) { if (e.Item is RadRotatorItem) { RadRotatorItem rotatorItem = (RadRotatorItem)e.Item; string PhotoID = (rotatorItem.FindControl("lblPhotoID") as Label).Text; string strTitle = (rotatorItem.FindControl("lblTitle") as Label).Text; string strDescription = (rotatorItem.FindControl("lblDescription") as Label).Text; RadBinaryImage thumbNail = (rotatorItem.FindControl("imgHiddenPhoto") as RadBinaryImage); imgPhoto.ImageUrl = thumbNail.ImageUrl; lblPhotoID.Text = PhotoID; txtPhotoTitle.Text = strTitle; txtPhotoDescription.Text = strDescription; } } protected void btnUpload_Click(object sender, EventArgs e) { foreach (UploadedFile f in AsyncUpload1.UploadedFiles) { byte[] photo = EM_Functions.GetFileBytes(f.InputStream); photo = EM_Functions.ResizeImage(photo, 400); byte[] thumbnail = EM_Functions.ResizeImage(photo, 115); string fileType = EM_Functions.GetFileType(f.FileName); EM_Data.UploadPhoto(lblPhotoType.Text, int.Parse(lblPhotoKey.Text), int.Parse(lblPhotoSubKey.Text), photo, thumbnail, f.FileName, fileType, photo.Length, f.FileName, User.Identity.Name); } AsyncUpload1.Dispose(); thumbRotator.DataBind(); } protected void ibtnDeletePhoto_Click(object sender, ImageClickEventArgs e) { EM_Data.DeletePhoto(int.Parse(lblPhotoID.Text)); thumbRotator.DataBind(); } protected void ibtnSavePhoto_Click(object sender, ImageClickEventArgs e) { EM_Data.SavePhoto(int.Parse(lblPhotoID.Text), txtPhotoTitle.Text, txtPhotoDescription.Text); thumbRotator.DataBind(); } }public static void LoadGridConfiguration(RadGrid pRdg, long pIdGruppoUtente, bool loadDefaultString = false) { GridSettingsPersister gsp = new GridSettingsPersister(pRdg); using (DMWEntities context = new DMWEntities()) { long idControlloAspx = (from ctrl in context.ControlliAspx where (ctrl.NomeControllo == pRdg.ID) select ctrl.IdControlloAspx).SingleOrDefault(); if (idControlloAspx == 0) { throw new Exception("Grid Control not defined in database [ControlliAspx]"); } var stringaConfigurazioneGruppoUtente = (from pg in context.ProprietaGriglie where (pg.IdControlloAspx == idControlloAspx) && (pg.IdGruppoUtente == pIdGruppoUtente) select new { pg.StringaConfigurazione, pg.StringaConfigurazioneDefault }).FirstOrDefault(); if (loadDefaultString) { gsp.LoadSettings(stringaConfigurazioneGruppoUtente.StringaConfigurazioneDefault); } else { gsp.LoadSettings(stringaConfigurazioneGruppoUtente.StringaConfigurazione); } } }protected void btnPersistConfiguration_Clicked(object sender, EventArgs e) { MachinaWeb.ServerControls.RadPageView paginaConComboIdGruppoUtente = (MachinaWeb.ServerControls.RadPageView)((System.Web.UI.Control)MachinaWeb.ServerControls.Utility.FindControlType((Control)sender, typeof(MachinaWeb.ServerControls.RadPageView))); MachinaWeb.ServerControls.RadGrid gridUC = (MachinaWeb.ServerControls.RadGrid)((System.Web.UI.Control)MachinaWeb.ServerControls.Utility.FindControlType((Control)sender, typeof(MachinaWeb.ServerControls.RadGrid))); long selectedGU = long.Parse( ((RadComboBox)paginaConComboIdGruppoUtente.FindControl("blccmbGruppoUtente")).SelectedValue ); //MessageBox.ShowTelerik(Page, this, "Configurazione salvata (Id Gruppo " + blccmbGruppoUtente.SelectedValue + ")"); string gridName = gridUC.ID; using (DMWEntities context = new DMWEntities()) { long idControlloAspx = (from ctrl in context.ControlliAspx where (ctrl.NomeControllo == gridName) select ctrl.IdControlloAspx).SingleOrDefault(); if (idControlloAspx == 0) { throw new Exception("Grid Control not defined in database [ControlliAspx]"); } var propGriglia = (from pg in context.ProprietaGriglie where (pg.IdControlloAspx == idControlloAspx) && (pg.IdGruppoUtente == selectedGU) select pg).FirstOrDefault(); GridSettingsPersister gsp = new GridSettingsPersister(gridUC); string stringaConfigurazioneVista = gsp.SaveSettings(); if (propGriglia == null) { //Creates row in database [Proprieta griglie] ProprietaGriglie pgNew = new ProprietaGriglie() { IdGruppoUtente = selectedGU, NomeGriglia = gridName, StringaConfigurazione = stringaConfigurazioneVista, IdControlloAspx = idControlloAspx, DataCreazione = DateTime.Now, DataAggiornamento = DateTime.Now, IdUtente = ((SessionInformation)Session["sessionData"]).IdUtente }; context.ProprietaGriglie.AddObject(pgNew); context.SaveChanges(); } else { //Updates row [Proprieta griglie] var pg = (from pgUpd in context.ProprietaGriglie where (pgUpd.IdControlloAspx == idControlloAspx) && (pgUpd.IdGruppoUtente == selectedGU) select pgUpd).Single(); pg.StringaConfigurazione = stringaConfigurazioneVista; context.SaveChanges(); } } }public partial class Configurazione_VisteTabellari : System.Web.UI.Page{ private RadGrid rdg = new RadGrid(); protected void Page_Init(object sender, EventArgs e) { hfdIdCultura.Value = ((SessionInformation)Session["sessionData"]).IdCultura.ToString(); } protected override void InitializeCulture() { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(((SessionInformation)Session["sessionData"]).Cultura); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(((SessionInformation)Session["sessionData"]).Cultura); base.InitializeCulture(); } protected void Page_Load(object sender, EventArgs e) { //string resource_ModificareLayoutTabella = (string)GetGlobalResourceObject("Resource", "MessaggioModificaLayoutTabella"); using (DMWEntities context = new DMWEntities()) { if (!String.IsNullOrEmpty(hdfIdMascheraSelezionata.Value)) { long idMascheraSelezionata = long.Parse(hdfIdMascheraSelezionata.Value); string urlVisioneTabellare = (from masc in context.Maschere where masc.IdMaschera == idMascheraSelezionata select masc.UrlControlloVistaTabellare).Single<string>(); try { RadGridStabilimenti uc = ((RadGridStabilimenti)LoadControl(urlVisioneTabellare)); uc.Type = CommonParameters.RadGridType.Configurazione; pnlVistaTabellare.Controls.Clear(); pnlVistaTabellare.Controls.Add(uc); } catch (Exception) { } //Loads stringa configurazione di default per la grid //RadGrid gridUC = ((IUserControlGrid)pnlVistaTabellare.Controls[0]).GetGrid(); //if (!Page.IsPostBack) //{ // try // { // Utility.LoadGridConfiguration(gridUC, ((SessionInformation)Session["sessionData"]).IdGruppoUtente, true); // } // catch (ArgumentNullException) // { // } //} string selectedGU = (((SessionInformation)Session["sessionData"]).IdGruppoUtente).ToString(); blccmbGruppoUtente.SelectedValue = selectedGU; blccmbGruppoUtente.DataBind(); //gridUC.DataBind(); } } } protected void rtsPagina_TabClick(object sender, RadTabStripEventArgs e) { rts_Pagina.SelectedIndex = e.Tab.Index; rmp_Pagina.SelectedIndex = e.Tab.Index; } protected void RadGridVisioniTabellari_ItemCreated(object sender, GridItemEventArgs e) { ////Sets filter's textbox width //if (e.Item is GridFilteringItem) //{ // //30px di differenza rispetto alla larghezza della colonna // GridFilteringItem gridFilteringItem = (GridFilteringItem)e.Item; // ((TextBox)(gridFilteringItem["NomeMaschera"]).Controls[0]).Width = Unit.Pixel((int)(900 - CommonParameters.GridFilterWidthDistances)); //} } protected void btnLoadConfiguration_Click(object sender, EventArgs e) { RadGrid gridUC = ((IUserControlGrid)pnlVistaTabellare.Controls[0]).GetGrid(); string gridName = gridUC.ID; GridSettingsPersister gsp = new GridSettingsPersister(gridUC); Utility.LoadGridConfiguration(gridUC, long.Parse(blccmbGruppoUtente.SelectedValue)); }}