Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
158 views

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>

 

Marin Bratanov
Telerik team
 answered on 01 Oct 2018
1 answer
1.0K+ views

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.

 

 

Marin Bratanov
Telerik team
 answered on 01 Oct 2018
1 answer
198 views

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

 

Marin Bratanov
Telerik team
 answered on 01 Oct 2018
0 answers
83 views

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? 

Max
Top achievements
Rank 1
 asked on 01 Oct 2018
5 answers
1.5K+ views
Hi,

We have to display around 2000 columns and max 200 rows in RadGrid.

Could you please let us know if this is feasible using RadGrid ro any alternate solution for the same. Number of rows is less for us but columns can be humongous.

Thanks & Regards
Nisha Suvarna
Eyup
Telerik team
 answered on 01 Oct 2018
16 answers
208 views

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

 

 

 

Rumen
Telerik team
 answered on 01 Oct 2018
2 answers
144 views

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>

Adrian
Top achievements
Rank 1
 answered on 28 Sep 2018
2 answers
81 views

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>
 
<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.

 

 

Eric
Top achievements
Rank 1
 answered on 28 Sep 2018
11 answers
313 views
Hi,

the SQLdatasource is not working with the grid.  I have no code-behind just using the SQLdatasource object.

Here is the code:

I used several examples on this forum but have had no luck in firing these events.

Thank You,

<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>
Tsvetomir
Telerik team
 answered on 28 Sep 2018
17 answers
262 views
When you use a master page and inside it uses RadPageLayout, the content of the web page you do not see in design mode in VS 2012 !!!

It 'a troublesome problem, because you can no longer edit in design mode in the construction of the web page.

I hope this is only an initial problem and not a desired behavior, as it is extremely annoying.

Thanks.
Rumen
Telerik team
 answered on 27 Sep 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?