<telerik:GridDateTimeColumn HeaderText="Creation Date" DataFormatString="{0:MM/dd/yyyy hh:mm:ss}" SortExpression="Created" ItemStyle-Wrap="false" UniqueName="Created" DataField="whenCreated" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" FilterControlWidth="100px" />I'm trying to get RadGrid to conditionally hide or disable a field when it is in edit mode based on the value of another field.
I have been able to get this to work when the grid displays the list of items, but once the grid enters edit mode, the columns display ...
I am using OnItemDataBound to successfully conditionally display during the initial load, but setting the items when the user clicks a row to get it into batch mode is not working.
I'm also trying to set the tab order when I go into edit mode, for some reason, the grid throws the cursor to the 2nd column ...
Note: PValue and CValue and in GridTemplateColumns, as is CardStatus.
public void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) {foreach (GridDataItem item in RadGrid1.Items) { string BoundColumnValue = item["CardStatus"].Text; // accessing GridBoundColumn value using ColumnUniqueName string BoundColumnValue2 = item["CValue"].Text; TextBox txtbx = (TextBox)item.FindControl("CardStatus"); Label numlb = (Label)item.FindControl("CardValue"); if (txtbx.Text.Equals("True")) { txtbx.ForeColor = Color.Red; numlb.Enabled = false; numlb.BackColor = Color.Yellow; numlb.ForeColor = Color.Red; //Just testing to see if it would evaluate } else { txtbx.ForeColor = Color.Beige; } //string TemplateColumnValue = lb.Text;// accessing Label Text. } foreach (GridEditableItem item in RadGrid1.EditItems) { string BoundColumnValue = item["CardStatus"].Text; // accessing GridBoundColumn value using ColumnUniqueName string BoundColumnValue2 = item["CValue"].Text; TextBox txtbx = (TextBox)item.FindControl("CardStatus"); if (txtbx.Text.Equals("True")) { txtbx.ForeColor = Color.Red; //numTxt.BackColor = Color.Yellow; //numTxt.ForeColor = Color.Red; } else { txtbx.ForeColor = Color.Beige; }}}I just need to be able to selectively prevent data entry in a column
The ASPX source is below:
<telerik:GridTemplateColumn ColumnEditorID="CValue" DataField="CValue" HeaderText="Card" UniqueName="CValue" ItemStyle-Width="75px" HeaderStyle-Width="75px"> <EditItemTemplate> <telerik:RadNumericTextBox ID="CValue" Width="50px" AllowOutOfRangeAutoCorrect="false" runat="server" MaxLength="1" MaxValue="1" NumberFormat-DecimalDigits="0" Text='<%# Bind("CValue") %>'></telerik:RadNumericTextBox> <asp:RequiredFieldValidator runat="server" ControlToValidate="CValue" ErrorMessage="<br />Required (0-1 Only)!" SetFocusOnError="true"></asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="CValue" Width="50px" runat="server" Text='<%# Bind("CValue") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="DateEdited" ReadOnly="true" Visible="false" DataType="System.DateTime" FilterControlAltText="Filter DateEdited column" HeaderText="DateEdited" SortExpression="DateEdited" UniqueName="DateEdited"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn UniqueName="CardStatus" DataField="CardStatus" ItemStyle-Width="50px" HeaderStyle-Width="50px"> <ItemTemplate> <asp:TextBox ID="CardStatus" Width="10px" runat="server" Text='<%# Bind("CardStatus") %>'></asp:TextBox> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="CardStatus" Width="10px" runat="server" Text='<%# Bind("CardStatus") %>'></asp:TextBox> </EditItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle> <FilterMenu EnableImageSprites="False"></FilterMenu></telerik:RadGrid>Any help / workarounds would be appreciated ... again, "just" need to
prevent editing in the CValue column when the CardStatus value is true
(bit field) ... using batch mode (using another solution isn't an option
now).
Also, the issue with the tab order being messed up is particularly frustrating ... any hints on that one?
Thanks
Larry

Is there any way to delete a record server side from a control outside of the RadGrid and have the grid update when the postback returns?
I have a LinkButton that handles deleting a record from the datasource and then calls the RadGrid Rebind method.
This triggers the NeedDataSource() method to fire and subsequently the RadGrid PreRender. The problem is that when the page finishes the postback, the deleted row is still visible in the grid. Any other interaction with the grid such as selecting a row or sorting, calls NeedDataSource again and the deleted row is gone.
I've verified that the data that comes back to NeedDataSource right after delete does not contain the row that was deleted.
There is a similar "Add" functionality that works fine. Meaning the row is added, data updated and Rebind called and grid shows the new row. I presume this is because the add calls a RadWindow that is still within the RadPanel that contains the RadGrid whereas the Delete button is outside of the Panel.
Here is the psuedo code of what I'm doing.
Private Sub ibtnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ibtnDelete.Click DeleteRecord()End SubPrivate Sub DeleteRecord() DeleteLogicHere() UpdateDataSourceHere() RadGrid1.Rebind()End SubProtected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource RadGrid1.DataSource = FetchDataSourceHere()End Sub
Here is a mockup of the aspx side.
<asp:LinkButton ID="ibtnDelete" CssClass="icon delete" TabIndex="10" runat="server" ToolTip="Delete Current Record"ClientClick="return confirm('Are you sure you want to delete this record? If yes, click OK.');"></asp:LinkButton><telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" CssClass="controlsWrapper"> <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" AllowPaging="True" AllowSorting="true" AutoGenerateColumns="false" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" OnPreRender="RadGrid1_PreRender" OnSortCommand="RadGrid1_SortCommand" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnPageSizeChanged="RadGrid1_PageSizeChanged"> </telerik:RadGrid></telerik:RadAjaxPanel>
I have also tried adding ibtnDelete to the RadAjaxManager with the RadGrid, but that did not resolve anything.

Hello all,
I've used the Theme Builder to configure a style for our internal hub, Ive created an Assembly with Bryans builder and added it to the bin folder.
Ive looked through various tutorials on the knowledge base from Loading Skins for External assemblies to manually referencing the skins in CSS and its really starting to drive me nuts.
If anyone could please point me in the right direction it would be most appreciated.
So here goes;
In my web.config file I have the following in <appSettings>:
<add key="Telerik.Skin" value="Vulcan"/><add key="Telerik.EnableEmbeddedSkins" value="false"/><add key="Telerik.EnableEmbeddedBaseStylesheet" value="true"/><add key="Telerik.Web.SkinsAssembly" value="Vulcan"/><add key="Telerik.Web.UI.StyleSheetFolders" value="~/App_Themes/Vulcan" />
Then in my MasterPage.aspx file I have the following - note for now i'm only referencing a single control:
<telerik:RadStyleSheetManager ID="RadStyleSheetManager" runat="server"> <StyleSheets> <telerik:StyleSheetReference Name="Vulcan.Button.Vulcan.css" Path="~/App_Themes/Vulcan/Button.Vulcan.css" Assembly="Vulcan" ></telerik:StyleSheetReference> </StyleSheets></telerik:RadStyleSheetManager>
And in the child page i have:
<telerik:RadButton ID="btnRecalculate" runat="server" Text="Recalculate" OnClick="btnRecalculate_Click" RenderMode="Lightweight" Skin="Vulcan" CssClass="btnRecalculate" />
However when I view the page I get a boring unstyled standard button, which obviously I can style via CSS but that would defeat the object.
Please advise, as I'm at my wits end with the software, which has lots of cool features and functionality, but the the corporate styling is driving me crazy
Many thanks


I have several grids on a page that I have enabled the Telerik Busy Indicator using the RadAjaxManager. The busy indicator works fine on all of the grid except for one. I keep getting the error "Error: Unable to get property 'Cols' of undefined or null reference" only when I export to Excel or PDF. On the "btnRun" click the indicator displays like normal, but when I export I get the error. I did see another post in which this same error displayed but I've verified that I only have one instance of the AjaxManager.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdateInitiatorPanelsOnly="true" ClientEvents-OnRequestStart="requestStart" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="cmdLoad">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="usrStatus" />
<telerik:AjaxUpdatedControl ControlID="grdScoreCard" />
<telerik:AjaxUpdatedControl ControlID="grdEHSMonthlyStats" />
<telerik:AjaxUpdatedControl ControlID="grdScoreCardTitles"/>
<telerik:AjaxUpdatedControl ControlID="grdScoreCardFormulaEntry"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnRun">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdScoreCardDashboard" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

We have a problem with the RadGrid DetailTables when using the Bootstrap skin.
When changing the background colour using the code behind with every other skin everything works perfectly, however, when using the Bootstrap skin, the alternative background colour of the skin seems to overwrite our set colour to the bootstrap alternative. This only affects the detail tables. The main Grid renders as expected.
The code for the ItemDataBound is working correctly. Everything works exactly as expected with ALL the other skins, just not the one I want to use!
Has anyone else come up against this issue? Any suggestions of a fix?
We are currently using Telerik UI for ASP.NET_AJAX 2017.3.913
Thanks
Chris

Hello!
I'm trying to use a pre formatted xlsx file as a starting point for my spreadsheet, and then trying to load data from my webservice (using a DropDownList to select a year) into some of its cells, so that the user can change the value of those cells and then hit the save button so that I can retrieve both the values and the formulas of the edited cells. However, I'm having trouble finding a solution that covers all the steps required for my program to work:
1) I tried using the SpreadsheetDocumentProvider to load my xlsx document, but then I don't know how to both load the data into the resulting spreadsheet, and also overriding its save function so that I can retrieve the values and formulas of the cells.
2) I tried overriding the SpreadsheetDataBaseProvider, which lets me load info from my webservice and into the cells I want, however I don't know how to load the format of my xlsx file, tell it which value is selected in the "Year" DropDownList so that I can load the correct values, or how I can send a parameter to the SaveWorkbook Method so that I save only certain cells.
Is it possible to do what I need with this control? Is there an example project I could use to learn more about it or should I use another controller entirely?
Thanks.
Is there a way to Export a RadGrid to PDF and have the PDF content fill more of the page? I have an output set for Letter Landscape. Here is the setup i'm using in the ItemCommand event.
grdScoreCardDashboard.ExportSettings.Pdf.BorderType = GridPdfSettings.GridPdfBorderType.AllBorders
grdScoreCardDashboard.ExportSettings.OpenInNewWindow = True
grdScoreCardDashboard.ExportSettings.IgnorePaging = True
grdScoreCardDashboard.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageRightMargin = Unit.Parse("10mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("10mm")
grdScoreCardDashboard.ExportSettings.Pdf.Title = "Score Card"
grdScoreCardDashboard.ExportSettings.Pdf.PaperSize = GridPaperSize.Letter
grdScoreCardDashboard.ExportSettings.FileName = String.Format("ScoreCardOutput-{0}", DateTime.Now.ToString("yyyyMMddhhmmss"))
grdScoreCardDashboard.ExportSettings.Pdf.AllowPrinting = True
grdScoreCardDashboard.ExportSettings.Pdf.AllowModify = True
grdScoreCardDashboard.ExportSettings.Pdf.AllowCopy = True
grdScoreCardDashboard.ExportSettings.ExportOnlyData = False
grdScoreCardDashboard.ExportSettings.Pdf.FontType = Telerik.Web.Apoc.Render.Pdf.FontType.Embed
