Using the following code I found in one of the demos. The radgrid is bound to a sqldatasource.
When I update or insert, there is no parameter created for the binary image to send data to the database ( I have added onUpdating and onInserting events to the sql data source, and have inspected the DBParameters collection, and there is no parameter passed containing the binary data of the image.) other columns from the grid are passed as parameters correctly, there is simply no sqlparameter for the image data.
How can I rectify this?
Also, the radupload dialog to select a image does not seem to work with the allowedfileextensions option. Also I specify jpg only, I see all file types in the selection dialog. Is there a way to only show those files w/ the allowed extensions?
<
telerik:GridTemplateColumn
DataField
=
"Data"
HeaderText
=
"Image"
UniqueName
=
"Upload">
<
ItemTemplate>
<
telerik:RadBinaryImage
runat
=
"server"
ID
=
"RadBinaryImage1"
DataValue='<%#Eval("Data") %>
AutoAdjustImageControlSize="false" Height="80px" Width="80px" ToolTip='<%#Eval("Name", "Photo of {0}") %>' AlternateText='<%#Eval("Name", "Photo of {0}") %>'>
</
telerik:RadBinaryImage
>
</
ItemTemplate>
<
EditItemTemplate>
<
telerik:RadAsyncUpload
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"AsyncUpload1"
AllowedFileExtensions
=
"jpg" >
</
telerik:RadAsyncUpload
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
Hi
how to find row values of a selected row in a radgrid? c#
I have a radbutton inside a radgrid.
<telerik:RadGrid ID="dg" runat="server" AllowSorting="true" Width="100%"
RenderMode="Auto" PageSize="10" AutoGenerateColumns="false"
AllowPaging="true">
<PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" PageSizeControlType="RadComboBox"
AlwaysVisible="true"></PagerStyle>
<MasterTableView HierarchyDefaultExpanded="false">
<CommandItemSettings AddNewRecordText="Nuevo" CancelChangesText="Cancelar" RefreshText="Actualizar"
ShowRefreshButton="false" />
<Columns>
<telerik:GridTemplateColumn HeaderText="Id" Visible="false">
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%# Eval("Idtip") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblIDEd" runat="server" Text='<%# Eval("Idtip") %>' Visible="false"></asp:Label>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Tipo">
<ItemTemplate>
<asp:Label ID="lblDescr" runat="server" Text='<%# Eval("Nombre") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEditDescr" runat="server" Text='<%# Eval("Nombre") %>' Width="220px"></asp:TextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn>
<ItemTemplate>
<telerik:RadButton ID="btnEditlist" runat="server" OnClick="btnEditlist_Click" Text="" RenderMode="Auto" CausesValidation="false">
<Icon PrimaryIconCssClass="rbEdit" />
</telerik:RadButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<%--<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>--%>
<telerik:GridButtonColumn Text="Delete" CommandName="Delete" />
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
</ClientSettings>
</telerik:RadGrid>
and the button event
protected void btnEditlist_Click(object sender, EventArgs e)
{
GridItem reng = sender as RadButton.NamingContainer as GridItem;
GridDataItem Info = sender as RadButton.NamingContainer as GridDataItem;
string Id = reng.FindControl("lblID") as Label.Text;
}
But I can“t find the row values.
Running 2018.3.910
request,
function
RefreshGrid() {
$find(
"ctl00_cphMain_RadAjaxManager1"
).ajaxRequest(
"Rebind"
);
getClientCart();
}
Manager,
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
OnAjaxRequest
=
"RadAjaxManager1_AjaxRequest"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"grCart"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"grCart"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"grCart"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"lvDelMethods"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
server side,
protected
void
RadAjaxManager1_AjaxRequest(
object
sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
if
(e.Argument ==
"Rebind"
)
{
grCart.Rebind();
lvDelMethods.Rebind();
}
}
Error in Firefox - works just fine in Chrome, Edge and IE.
TypeError: access to strict mode caller function is censored
_doPostBack http://localhost/Telerik.Web.UI.WebResource.axd:15:13769Function.createDelegate/< http://localhost/Telerik.Web.UI.WebResource.axd:6:305__doPostBack http://localhost/Telerik.Web.UI.WebResource.axd:30710:1__doPostBack http://localhost/Telerik.Web.UI.WebResource.axd:30710:1__doPostBack http://localhost/Telerik.Web.UI.WebResource.axd:30710:1ajaxRequest http://localhost/Telerik.Web.UI.WebResource.axd:1930:27RefreshGrid http://localhost/Scripts/cart.js:129:5<anonymous> http://localhost/Scripts/cart.js:117:9dispatch http://localhost/Scripts/plugins/jquery-3.3.1.min.js:2:41720add/y.handle http://localhost/Scripts/plugins/jquery-3.3.1.min.js:2:39774
Seems to be working if the request comes from the grid itself but not from the ajaxmanager request.
Any idea what causes this?
Christian
Hello,
I am using the pop-up editing on one of my grids where the user will then be able to edit the pre-existing record displayed on the list, however, by default, the pop-up windows width is too small to use as there will be a lot of fields the user can edit so they can not be in a single column meaning I will have to change the width of the window, I can set the width in the TagHelper (Inline styling) however i do not want to do this, is there for the kendo window to take around 80% of the screen space without any inline styling?
Hi
I am seeing a strange effect in all browsers when using radcheck box with the 'Simple' skin; there is a separate light grey box appearing behind the box using the Simple skin, offset by a couple of pixels. It looks like it is being rendered in Default skin AND simple skin. (attached file)
What could explain this?
I do need to use the simple skin for consistency with all other controls, so change ins not really an option.
I am using 2016 asp.net ajax control set
Thanks for advice on this
Thanks
Clive
I read this article about custom marker from a datasource:
https://www.telerik.com/support/code-library/custom-markers-with-server-side-data-binding
From what I can tell, it should create a class for each marker by tacking on the field value to the end of "k-marker-<fieldvalue>". It seems that this article is old and it actually creates the class of "k-i-marker-<fieldvalue>", no biggie, I figured that out. I managed to change the color and the marker image and everything. The issue is, the creation of the class seems messed up. It works for some values, but not others and I can't figure out what the issue is. The only thing that I can see is it works for values that are TWO characters long, but anything more it puts the first letter, then a hyphen and the rest of the value.
Here are three examples it created:
<span class="k-marker k-icon k-i-marker-bp" title="BP 17869" data-role="tooltip" style="z-index: 1000; left: 343px; top: 435px;"></span>
<span class="k-marker k-icon k-i-marker-c-oSTCO" title="Costco Wholesale - TRACY - 0658" data-role="tooltip" style="z-index: 1000; left: 24px; top: 297px;"></span>
<span class="k-marker k-icon k-i-marker-r-aLPHS" title="Ralphs #189" data-role="tooltip" style="z-index: 1000; left: 32px; top: 310px;"></span>
On IE11 when the browser width is 1014 the HiddenMd="True" setting should be hiding the row. This works correctly on Edge and Chrome. Here is a test page to recreate the problem.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TelerikTest.aspx.cs" Inherits="MEDP.Portal.TelerikTest" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>Telerik Test</
title
>
<
meta
http-equiv
=
"X-UA-Compatible"
content
=
"IE=Edge"
/>
</
head
>
<
body
>
<
telerik:RadScriptManager
ID
=
"PortalRootScriptManager"
runat
=
"server"
EnablePageMethods
=
"true"
>
<
Scripts
>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
h1
>Test site</
h1
>
<
telerik:RadPageLayout
runat
=
"server"
GridType
=
"Fluid"
CssClass
=
"MainContainer"
>
<
Rows
>
<
telerik:LayoutRow
runat
=
"server"
RowType
=
"Container"
WrapperHtmlTag
=
"None"
HiddenMd
=
"True"
HiddenSm
=
"True"
HiddenXs
=
"True"
>
<
Content
>
<
div
>
Should be hidden in IE11 at 1014 resolution!
</
div
>
</
Content
>
</
telerik:LayoutRow
>
</
Rows
>
</
telerik:RadPageLayout
>
</
body
>
</
html
>
Please advise on how to fix this problem on IE 11.
<
telerik:RadScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadGrid
ID
=
"rdgBudget"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"SEMBudgetSource"
GridLines
=
"None"
Skin
=
"Office2007"
AllowAutomaticInserts
=
"true"
AllowAutomaticUpdates
=
"true"
OnItemDataBound
=
"Budget_ItemDataBound"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"SEMBudgetSource"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"SEMBudgetId"
>
<
EditFormSettings
>
<
EditColumn
CancelImageUrl
=
"../Images/Cancel.gif"
EditImageUrl
=
"../Images/Edit.gif"
InsertImageUrl
=
"../Images/Insert.gif"
UniqueName
=
"EditCommandColumn"
UpdateImageUrl
=
"../Images/Update.gif"
>
</
EditColumn
>
</
EditFormSettings
>
<
Columns
>
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
ButtonType
=
"ImageButton"
/>
<
telerik:GridBoundColumn
DataField
=
"SEMBudgetId"
DataType
=
"System.Int32"
ReadOnly
=
"True"
UniqueName
=
"SEMBudgetId"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Customer"
DefaultInsertValue
=
""
HeaderText
=
"Customer"
SortExpression
=
"Customer"
UniqueName
=
"Customer"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"MarginBudget"
DataType
=
"System.Decimal"
DefaultInsertValue
=
""
HeaderText
=
"SEM Budget"
SortExpression
=
"MarginBudget"
UniqueName
=
"MarginBudget"
DataFormatString
=
"{0:C}"
ItemStyle-HorizontalAlign
=
"Right"
>
<
ItemStyle
HorizontalAlign
=
"Right"
></
ItemStyle
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"BudgetSpent"
DataType
=
"System.Decimal"
DefaultInsertValue
=
""
HeaderText
=
"Budget Spent"
SortExpression
=
"BudgetSpent"
UniqueName
=
"BudgetSpent"
ReadOnly
=
"true"
DataFormatString
=
"{0:C}"
ItemStyle-HorizontalAlign
=
"Right"
>
<
ItemStyle
HorizontalAlign
=
"Right"
></
ItemStyle
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"BudgetStartDate"
DataType
=
"System.DateTime"
DefaultInsertValue
=
""
HeaderText
=
"Start Date"
SortExpression
=
"BudgetStartDate"
UniqueName
=
"BudgetStartDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"BudgetEndDate"
DataType
=
"System.DateTime"
DefaultInsertValue
=
""
HeaderText
=
"End Date"
SortExpression
=
"BudgetEndDate"
UniqueName
=
"BudgetEndDate"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"BudgetIsActive"
DataType
=
"System.Boolean"
DefaultInsertValue
=
""
HeaderText
=
"BudgetIsActive"
SortExpression
=
"BudgetIsActive"
UniqueName
=
"Active"
>
</
telerik:GridCheckBoxColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
DataBinding-EnableCaching
=
"true"
>
<
DataBinding
EnableCaching
=
"True"
>
</
DataBinding
>
</
ClientSettings
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SEMBudgetSource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:myconnection %>"
SelectCommand="SELECT [Customer], [MarginBudget], [SEMBudgetId], [BudgetStartDate], [BudgetEndDate], [BudgetIsActive], [BudgetSpent] FROM [mytesttable] WHERE ([companyid] IS NOT NULL) ORDER BY [Customer]"
InsertCommand="INSERT INTO mytesttable(Customer, MarginBudget, BudgetStartDate, BudgetEndDate, BudgetIsActive) VALUES (@Customer, @Budget, @StartDate, @EndDate, @Active)"
UpdateCommand="UPDATE mytesttable SET Customer = @Customer, MarginBudget = @Budget, BudgetStartDate = @StartDate, BudgetEndDate = @EndDate, BudgetIsActive = @Active WHERE (SEMBudgetId = @BID)">
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Customer"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Budget"
Type
=
"Decimal"
/>
<
asp:Parameter
Name
=
"StartDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"EndDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"Active"
Type
=
"Boolean"
/>
<
asp:Parameter
Name
=
"BID"
Type
=
"Int32"
/>
</
UpdateParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"Customer"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Budget"
Type
=
"Decimal"
/>
<
asp:Parameter
Name
=
"StartDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"EndDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"Active"
Type
=
"Boolean"
/>
</
InsertParameters
>
</
asp:SqlDataSource
>