or
<telerik:RadGrid ID="InvoicesGrid" runat="server" Skin="Sullivans" EnableEmbeddedSkins="false" CellPadding="3" GridLines="None" AlternatingItemStyle-CssClass="orderAltRow" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" OnNeedDataSource="InvoicesGrid_NeedDataSource" OnItemDataBound="InvoicesGrid_ItemDataBound" OnPageIndexChanged="InvoicesGrid_PageIndexChanged"> <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle> <MasterTableView Width="100%" DataKeyNames="Header.Invoice_No" AllowMultiColumnSorting="False" ShowFooter="true" AllowNaturalSort="False"> <Columns><!-- Bunch of columns removed. --> <telerik:GridBoundColumn DataField="Header.Invoice_Dt" HeaderText="Date" DataFormatString="{0:d}" Aggregate="None" DataType="System.String" /> </Columns> </MasterTableView></telerik:RadGrid>InvoicesGrid.DataSource = details;I am tring to save the user data for persisting grid settings to a sql database, using the exact code from the demo site.
protected void btnSaveSettings_Click(object sender, EventArgs e) { string user = UserSelection.SelectedValue; GridSettingsPersister SavePersister = new GridSettingsPersister(RadGrid1); Session[user] = SavePersister.SaveSettings(); InfoImage.Visible = true; StatusLabel.Text = "Settings for " + user + " saved successfully!"; btnLoadSettings.Enabled = true; }
SavePersister.SaveSettings() is of type String, so I don;t know what the problem is.
However, when I try to save the string into a sql varchar(max) field, it fails. Or rather, LoadSettings(string value) is failing.
Is anyone else having this problem? Is there example code of saving the settings to a DB?
BONUS QUESTION: I need to add a RESET button. Can you pass String.Empty into loadsettings?