Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
135 views

greeting ,,

I want to put image in  CellTemplate as field from database



                                <telerik:RadPivotGrid ID="RadPivotGrid3" runat="server" AllowFiltering="False" AllowPaging="True"
                            AllowSorting="True" ShowColumnHeaderZone="False" ShowDataHeaderZone="False" ShowRowHeaderZone="False"
                            Width="100%" ShowFilterHeaderZone="False" AggregatesLevel="1">
                            <PagerStyle ChangePageSizeButtonToolTip="Change Page Size" PageSizeControlType="RadComboBox" />
                            <Fields>
                                 <telerik:PivotGridRowField DataField="bank_nat_name" UniqueName="bank_nat_name" SortOrder="Ascending">
                                    <CellStyle Width="100" />
                                    <CellTemplate>
                                    <asp:Image ID="flag_logo" runat="server" Visible="true"
                            Width="50px" Height="50px" ImageUrl='<%#"~/Files/Bank_nat_Photo/" + CStr(Eval("bank_logo", "{0}"))%>'/>
                                    </CellTemplate>

                                </telerik:PivotGridRowField>
                                <telerik:PivotGridRowField DataField="bankname" UniqueName="bankname" SortOrder="Ascending">
                                    <CellStyle Width="100" />
                                    <CellTemplate>
                                    <asp:Image ID="bank_logo1" runat="server" Visible="true"
                            Width="50px" Height="50px" ImageUrl='<%# "~/Files/Banks_Photo/" + CStr(Eval("bank_logo", "{0}"))%>'/>
                                    </CellTemplate>

                                </telerik:PivotGridRowField>
                                <telerik:PivotGridColumnField DataField="MONTHT" UniqueName="MONTHT">
                                </telerik:PivotGridColumnField>
                                <telerik:PivotGridAggregateField Aggregate="sum" DataField="TotalOS" UniqueName="TotalOS">
                                    <TotalFormat Level="0" Axis="Rows" TotalFunction="NoCalculation" SortOrder="Ascending">
                                    </TotalFormat>
                                </telerik:PivotGridAggregateField>
                                <telerik:PivotGridAggregateField Aggregate="sum" DataField="TargetAmount" UniqueName="TargetAmount">
                                    <TotalFormat Level="0" Axis="Rows" TotalFunction="NoCalculation" SortOrder="Ascending">
                                    </TotalFormat>
                                </telerik:PivotGridAggregateField>

                            </Fields>
                            <ConfigurationPanelSettings EnableDragDrop="False" EnableOlapTreeViewLoadOnDemand="True" />
                            <ExportSettings IgnorePaging="True" OpenInNewWindow="True" />
                        </telerik:RadPivotGrid>

CodeBehind


   Sub GetSummeryTarget()

        Dim col As String = "bank_nat_name,bank_name,TotalOS,TargetAmount,MONTHT,bank_logo,flag_logo"

        Dim ds As New DataSet : ds = GeneralUtilities.FillSql("select " + col + " from V_TargetDPviot ")


        RadPivotGrid3.DataSource = ds


    End Sub

    Private Sub RadPivotGrid3_NeedDataSource(sender As Object, e As PivotGridNeedDataSourceEventArgs) Handles RadPivotGrid3.NeedDataSource
        GetSummeryTarget()
    End Sub

ahmed
Top achievements
Rank 1
 asked on 29 Jun 2021
0 answers
156 views

Hi Team,


<telerik:RadGrid ID="TestRadGrid" AllowCustomPaging="true" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" 
              AutoGenerateColumns="False" GridLines="none" AllowMultiRowSelection="true"
              GroupingSettings-CaseSensitive="false" PageSize="50" Skin="BDS" EnableEmbeddedSkins="false"
              ShowGroupPanel="false" UseEmbeddedScripts="false" Width="100%" runat="server">
       <SortingSettings SortedAscToolTip="Sorted Ascending" SortedDescToolTip="Sorted Descending" />
  <MasterTableView CommandItemDisplay="Top" DataKeyNames="Guid" ClientDataKeyNames="Guid" Width="100%" AllowNaturalSort="false">
<Columns>
            <Query:NewGridBoundColumn DataField="Action" FilterOptions="Added,Updated" FilterWidth="55px" HeaderButtonType="TextButton" HeaderText="Change" SortExpression="Action" UniqueName="ChangeType" meta:resourceKey="ChangeTypeColumn"/>
            <Query:NewGridBoundColumn DataField="EntityTypeName" FilterOptions="Order,Product" FilterWidth="60px" HeaderButtonType="TextButton" HeaderText="Type" SortExpression="EntityTypeName" UniqueName="EntityType" meta:resourceKey="EntityTypeColumn" />
   </Columns>
    </MasterTableView>
      <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <ClientSettings AllowColumnHide="false"  AllowColumnsReorder="false" AllowDragToGroup="false" 
                    AllowGroupExpandCollapse="false" AllowKeyboardNavigation="false" AllowRowHide="false" 
                    ReorderColumnsOnClient="false" EnableRowHoverStyle="true">
   <ClientEvents OnRowMouseOut="TestRowMouseOut" OnRowMouseOver="TestRowMouseOver" OnRowSelected="TestRowSelected" OnRowSelecting="TestRowSelecting" />
        <Resizing AllowRowResize="false" AllowColumnResize="false" ClipCellContentOnResize="false" EnableRealTimeResize="false" ResizeGridOnColumnResize="False" />
        <Scrolling AllowScroll="false" SaveScrollPosition="false"/>
        <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" CellSelectionMode="None"/>
    </ClientSettings>
</telerik:RadGrid>

In the above code,

1.I have issue with MultiRowSelection even after placing AllowMultiRowSelection="true"

Hovering rows is not happening.Not able to select multiple rows.

2.Trying to use customname GridBoundColumn(Query) by register of namespace but its not rendering.

Can anyone please help what has to be changed?


Javascript Code:

In the below code,

We are getting this issue after migration of RadGrid with R32020 version.

Issue: i am getting error with this.Rows.rowIndex (Cannot read property [object object] of undefined at Array.TestRowMouseOver),Telerik.Web.UI.RadGrid.raiseEvent,Telerik.Web.UI.RadGrid.raise_rowMouseOver,Telerik.Web.UI.RadGrid._mouseover.

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
     var _TestWindowActive = false;
    var sortColumnHash = [];
   
    function TestWindowOver() { _TestWindowActive = true; }

    function TestWindowOut() { TestWindowClose(); }

    function TestRowMouseOut(rowIndex) {
        this.Rows[rowIndex].Control.style.backgroundColor = "";
    }

    function TestRowMouseOver(rowIndex) {
       
        if (this.Rows[rowIndex].Control.className.indexOf("disabled") == -1) {
            this.Rows[rowIndex].Control.style.backgroundColor = "#DFDFDF";
            this.Rows[rowIndex].Control.style.cursor = "hand";
        }
    }

    function TestRowSelecting(row) {
        if (row.Control.className.indexOf("disabled") != -1)
            return false;
    }

    function TestRowSelected(row) {
        var radWindow = Query.Utilities.WindowUtil.openRADWindow("TestEditWindow", "TestEdit.aspx?id=" + row.KeyValues["Guid"]);
        radWindow.Restore();

        var close = document.getElementById("CloseButton" + radWindow.Id);
        close.onclick = CloseRadWindow;
    }
</Script>
</telerik:RadCodeBlock>

Can anyone help me to resolve the issue.

Sachita
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 28 Jun 2021
0 answers
95 views

Hi All,
I have an issue in telerik RadScheduler.
When adding a visit in the last half hour of scheduler time, the time slots shift to above.
In this case the visit start time is “11:50” and visit length is “10 min”.

bodda
Top achievements
Rank 1
 asked on 28 Jun 2021
1 answer
134 views

Hi,

 

How could one get the selected value from a radsearchbox client template back to the server code?

Is there any other method than sending it in a url querystring?

 

Thanks, Marc

 

Attila Antal
Telerik team
 answered on 28 Jun 2021
1 answer
135 views

HI,

I can't submit the form when insert and update forms are opened simultaneously . I am trying to define separate validation groups for insert and update as it explained in the following link.

Radgrid perform validation only in edit or insert mode and not both. in UI for ASP.NET AJAX | Telerik Forums

But getting object reference error in the following code on PerformInsertButton and UpdateButton.

protected void RadGridFilePlanCEDMSFunctional_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                var rvValue = (RequiredFieldValidator)e.Item.FindControl("RadCboRetentionGracePeriodMonthValidator");

                if (e.Item is GridEditFormInsertItem)
                {
                    rvValue.ValidationGroup = "addRowValidation";
                    
                    ((e.Item as GridEditFormItem).FindControl("PerformInsertButton") as LinkButton).ValidationGroup = "FunctionalAddRowValidation";
                }
                else
                {
                    rvValue.ValidationGroup = "editRowValidation";
                    ((e.Item as GridEditFormItem).FindControl("UpdateButton") as LinkButton).ValidationGroup = "FunctionalEditRowValidation";
                }
            }
        }

 

Edit form template html is defined as follows...any help will be appreciated!

<%--EDIT MODE Controls--%>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table id="Table2" style="width: 100%; border-spacing: 2px; padding: 2px; border: 1px; border-collapse: collapse" class="table">
                                    <tr style="height: 10px">
                                        <td colspan="3"></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 60px"></td>
                                        <td>
                                            <table id="Table3" style="width: 450px; border: 0px;">
                                                <tr>
                                                    <td style="vertical-align: middle">
                                                        <asp:Label ID="lblDocumentType" runat="server">Document Type:</asp:Label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="RadCboDocumentType" runat="server" RenderMode="Lightweight" Width="250px" Visible="true" TabIndex="1"
                                                            DataSourceID="dsDocumentTypes" DataTextField="DocumentTypename" DataValueField="DocumentTypeId" 
                                                            EmptyMessage="Select DocumentType" SelectedValue='<%# Bind("DocumentTypeId") %>'>
                                                        </telerik:RadComboBox>
                                                        <br />
                                                        
                                                    </td>
                                                </tr>
                                                <tr style="height: 5px">
                                                    <td colspan="2"></td>
                                                </tr>
                                                <tr>
                                                    <td style="vertical-align: middle">
                                                        <asp:Label ID="lblSite" runat="server">Site:</asp:Label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="RadCboSite" runat="server" RenderMode="Lightweight" Width="250px" Visible="true" TabIndex="2"
                                                            DataSourceID="dsSites" DataTextField="SiteName" DataValueField="SiteId" 
                                                            EmptyMessage="Select Site" SelectedValue='<%# Bind("SiteId") %>'>
                                                        </telerik:RadComboBox>
                                                        <br />
                                                        
                                                    </td>
                                                </tr>
                                                <tr style="height: 5px">
                                                    <td colspan="2"></td>
                                                </tr>
                                                <tr>
                                                    <td style="vertical-align: middle">
                                                        <asp:Label ID="lblRetYear" runat="server">Retention Year:</asp:Label>
                                                    </td>
                                                   <td>
                                                        <telerik:RadComboBox ID="RadCboRetentionYear" runat="server" RenderMode="Lightweight" Width="250px" TabIndex="3"
                                                            DataSourceID="dsRetentionYear" DataTextField="RetentionYear" SelectedValue='<%# Bind("RetentionYear") %>'
                                                            DataValueField="RetentionYear" EmptyMessage="Select Year">
                                                        </telerik:RadComboBox>
                                                        <br />
                                                        
                                                    </td>
                                                </tr>
                                                <tr style="height: 5px">
                                                    <td colspan="2"></td>
                                                </tr>
                                                <tr>
                                                    <td style="vertical-align: middle">
                                                        <asp:Label ID="lblRetMonth" runat="server">Retention Month:</asp:Label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="RadCboRetentionMonth" runat="server" RenderMode="Lightweight" Width="250px" TabIndex="4"
                                                            DataSourceID="dsRetentionMonth" DataTextField="RetentionMonth" SelectedValue='<%# Bind("RetentionMonth") %>'
                                                            DataValueField="RetentionMonth" EmptyMessage="Select Month">
                                                        </telerik:RadComboBox>
                                                        <br />
                                                        
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
                                            <table id="Table1" style="padding: 1px; border-spacing: 1px; border: 0px;">
                                                <tr>
                                                    <td style="vertical-align: middle">
                                                        <asp:Label ID="lblRetGPMonth" runat="server">Retention Grace Period Month:</asp:Label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="RadCboRetentionGracePeriodMonth" runat="server" RenderMode="Lightweight" Width="268px" TabIndex="5"
                                                            DataSourceID="dsRetentionGracePeriodMonth" DataTextField="RetentionGracePeriodMonth" SelectedValue='<%# Bind("RetentionGracePeriodMonth") %>'
                                                            DataValueField="RetentionGracePeriodMonth" EmptyMessage="Select Month" >
                                                        </telerik:RadComboBox>
                                                        <br />
                                                        <asp:RequiredFieldValidator ID="RadCboRetentionGracePeriodMonthValidator" ControlToValidate="RadCboRetentionGracePeriodMonth"
                                                            runat="server" ErrorMessage="Retention Grace Period Month is a required field" Display="Dynamic" 
                                                            ForeColor="Red"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr style="height: 5px">
                                                    <td colspan="2"></td>
                                                </tr>
                                                <tr style="height: 5px">
                                                    <td colspan="2"></td>
                                                </tr>
                                                <tr>
                                                    <td style="vertical-align: top">
                                                        <asp:Label ID="lblComments" runat="server">Comments:</asp:Label>
                                                    </td>
                                                    <td>
                                                        <telerik:RadTextBox ID="RadTextBox" runat="server" TextMode="MultiLine" Rows="6" Columns="40" Wrap="true"
                                                            MaxLength="250" Text='<%# Bind("Comments") %>'>
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr style="height: 10px">
                                        <td colspan="3"></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 60px"></td>
                                        <td style="text-align: center;" colspan="2">
                                            <telerik:RadButton RenderMode="Lightweight" ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Add" : "Update" %>'
                                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                            </telerik:RadButton>
                                            &nbsp;
                                            <telerik:RadButton RenderMode="Lightweight" ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                CommandName="Cancel">
                                            </telerik:RadButton>
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr style="height: 10px">
                                        <td colspan="3"></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 60px"></td>
                                        <td class="insideHeader" colspan="2"></td>
                                    </tr>
                                    <tr style="height: 10px">
                                        <td colspan="3"></td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
Attila Antal
Telerik team
 answered on 25 Jun 2021
1 answer
408 views

Hello, I followed the instructions here to create a new localization file for es, and set the text for spanish (es), and modified some of the text for english.

I built the application, and the text I put in for both english and spanish do not show.

I then changed the "build action" for the RadAsyncUpload.es.resx and RadAsyncUpload.resx to "Embedded Resource", which is what I've done with the other resource files included in this project.

Same result.  Neither the english or spanish text shows.

I have the culture set in the code to use the same culture another resource file is using, which is based on the detected culture of the browser:

this.RadAsyncUpload1.Culture = mainPage.Culture;

Even if that wasn't working, the english changes I made should show?

I made sure the satellite es resources dll for the project is deployed as well.

What am I missing?

Attila Antal
Telerik team
 updated answer on 25 Jun 2021
1 answer
133 views

Hello,
to test the input I would like to set default values for the form. I do that in the OnItemCommand. The values for the properties "ShortName" and "LegalForm" are displayed, the other values are not.

 

Codebehind:

 protected void rgCompanyies_OnItemCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "ViewCustomers")
                {
                    Response.Redirect(EditUrl("Id", e.CommandArgument.ToString(), "ViewCustomer"));
                }

                if (e.CommandName == RadGrid.InitInsertCommandName)
                {
                    if (IsDebugMode)
                    {
                        e.Canceled = true;
                        Hashtable values = new Hashtable();

                        string[] legalForms = { "GmbH", "AG", "Gbr", "OHG", "KG" };

                        Random rnd = new Random();
                        values["ShortName"] = $"A-Test{rnd.Next(10)}";
                        values["LegalForm"] = legalForms[rnd.Next(legalForms.Length)];
                        values["CompanyAddress.Street"] = $"Teststr. {rnd.Next(10)}";
                        values["CompanyAddress.Postalcode"] = $"{rnd.Next(10)}2345";
                        values["CompanyAddress.City"] = "Bonn";
                        values["CompanyPhone.Number"] = $"123456{rnd.Next(10)}";
                        values["CompanyEmail.Address"] = $"a.decke{rnd.Next(10)}@abc.de";

                        e.Item.OwnerTableView.InsertItem(values);
                    }
                }
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }

 

Views.ascx:


 <EditFormSettings CaptionFormatString="Bearbeite &lt;strong&gt;{0}&lt;/strong&gt;" EditFormType="Template" InsertCaption="Firma bearbeiten..." CaptionDataField="ShortName">
                        <FormTemplate>
                            <div id="main" class="container">
                                <div class="row mt-4">
                                    <div class="col-12">

                                        <div class="card">
                                            <!--Firmendaten-->
                                            <div class="card-header">
                                                Firmendaten
                                            </div>
                                            <div class="card-body">
                                                <div class="row g-2">
                                                    <!--CompanyTitle & CompanyTyp-->
                                                    <div class="col-md-6">
                                                        <label for="inputTitle" class="form-label-required">Title</label>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvInputCompanyName" ControlToValidate="tbCompanyName" Display="Dynamic" SetFocusOnError="True" CssClass="form-label-error float-end" ErrorMessage="Ein Firmenname wird erwartet!" ValidationGroup="vgCompany"/>
                                                        <asp:CustomValidator ID="cuvCompanyName" ControlToValidate="tbCompanyName" runat="server" Display="Dynamic" ErrorMessage="Firmenname bereits vorhanden!" CssClass="form-label-error float-end" SetFocusOnError="True" ValidationGroup="vgCompany" OnServerValidate="cuvInputCompanyName_OnServerValidate"/>
                                                        <asp:TextBox autofocus ID="tbCompanyName" Text='<%# Bind("ShortName") %>' runat="server" CssClass="form-control" ValidationGroup="vgCompany" TabIndex="10" required/>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <label for="inputType" class="form-label">Firmentyp</label>
                                                        <asp:TextBox ID="tbCompanyLeagalForm" runat="server" Text='<%# Bind("LegalForm") %>' CssClass="form-control"/>
                                                    </div>
                                                    <!--Postalcode & Location-->
                                                    <div class="col-md-6">
                                                        <label for="inputPostalcode" class="form-label-required">PLZ</label>
                                                        <asp:RequiredFieldValidator runat="server" ID="rfvCompanyPostalcode" ControlToValidate="tbCompanyPostalcode" Display="Dynamic" SetFocusOnError="True" CssClass="form-label-error float-end" ErrorMessage="Eine PLZ wird erwartet!" ValidationGroup="vgCompany"/>
                                                        <asp:TextBox ID="tbCompanyPostalcode" Text='<%# Bind("CompanyAddress.Postalcode") %>' runat="server" CssClass="form-control" ValidationGroup="vgCompany" TabIndex="20" required/>
                                                    </div>

 

the values for ShortName and LegalForm are displayed correctly (show image). The CompanyAddress.Street, CompanyAddress.Postalcode, etc. values are not displayed. Why doesn't the binding work there?

Attila Antal
Telerik team
 answered on 25 Jun 2021
3 answers
379 views

Hi there,

I would like to see the focus on the rows or just in the Visibility cell when I'm navigating through the grid using the keyboard and if I press enter, make a click on the toggle button to change the visibility. 

Also, I´m adding in the clientSettings 

 

Doncho
Telerik team
 answered on 25 Jun 2021
1 answer
365 views

I have a radgrid that is working as expected showing me the pencil and the X icon for the edit and delete controls shown below.

<telerik:GridEditCommandColumn />
      <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" />

 

When I add a second grid to the page, even just an empty grid with nothing specified about the grid, the icons for Edit and Delete disappear in the first grid.

Any ideas on what is happening here?

Doncho
Telerik team
 answered on 25 Jun 2021
1 answer
100 views

I have a Radgrid with a detail table (a sub-grid).  The sub-grid rows always have a border around them (see the attached image) and I would like to eliminate the top and bottom lines.

I have already tried setting BorderStyle="None" and BorderWidth="0" on both the main grid and the detail table, but that has not changed anything.

How would I accomplish this?

Doncho
Telerik team
 answered on 25 Jun 2021
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?