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

Hi,

I'm having problems with the style regarding the pager part of my RadGrid (see attachment). I use it with Bootstrap v. 5.3.3. Can you explain to me what I need to add in my CSS file to fix.

Thank you
Dario

 

lukas69
Top achievements
Rank 1
 asked on 16 Apr 2024
0 answers
21 views
Hello,

When I tried to filter my other columns it seems working, but for the payment type column, im getting error: At least one object must implement IComparable

Client model:
public Guid Id { get; set; }

[Display(Name = "Client Code")]
public string Ref { get; set; }

[Display(Name = "Company Name")]
public string CompanyName { get; set; }

[Display(Name = "Payment Options")]
public List<PaymentTypeViewModel> PaymentTypes { get; set; }


payment type model:
using System;

namespace Act2.Certificate.Api.Models.Client
{
    public class PaymentTypeViewModel
    {
        public Guid Id { get; set; }

        public string Name { get; set; }

        public bool Selected { get; set; }
    }
}


Controller file:
    public async Task<IActionResult> GetClientList([DataSourceRequest] DataSourceRequest request
       )
    {
        try
        {
            var list = await _mediator.Send(new ClientsQuery());
            
            DataSourceResult result = list.ToDataSourceResult(request);
            return new JsonResult(result);
        }
        catch (Exception ex)
        {
            return BadRequest(new { message = ex.Message });
        }
    }
}

Do take note, that the payment type has multiple value per row, see below image:
Francis
Top achievements
Rank 1
 asked on 11 Apr 2024
0 answers
23 views

I have a Telerik RadGrid that has a DetailTable that can be expanded by the user. The DetailTable contains several selectable rows. The user is able to select some rows, then click a "Process Data" button that saves the row data in a Visual Basic code-behind file.

The RadGrid uses HierarchyLoadMode="conditional" to keep track of the DetailTable.

Two Problems-

1. When a user:
    - expands the DetailTable,
    - selects a row,
    - collapses the DetailTable,
    - clicks "Process Data,"
no data is saved because RadGrid.SelectedItems has 0 items. Even though the selected row is shown as selected in the UI.

However, if a user:
    - selects a row,
    - collapses the detail table,
    - clicks "Process Data" + gets an error from the VB saying "No rows selected," 
    - expands the detail table again,
    - selects the row again,
    - clicks "Process Data" again,
then the data will be saved because RadGrid.SelectedItems will include the row. Perhaps this is a bug?

In other words, a post back is needed to clear the detail table selections before RadGrid.SelectedItems actually includes items that have been selected in a collapsed HierarchyLoadMode="conditional" table.

2. Is there a way to have selections persist across pagination? Eg. If the user expands the DetailTable, selects a row, navigates to "page 2" of the detail table, then navigates back to "page 1," their selection is not saved.

John
Top achievements
Rank 1
 asked on 25 Mar 2024
0 answers
20 views

Hi,

I have following grind in Batch Edit mode, is it possible to change cboKAC DataSourceID in code behind or JS? In other words - how to access controls on EditTemplate in Batch Edit mode?

Thanks,

Alex

<telerik:RadGrid ID="grdLinks" runat="server" AllowSorting="true" AllowPaging="false" Width="300px" Height="120px">
    <ClientSettings><Scrolling AllowScroll="true" /><Selecting AllowRowSelect="true" /></ClientSettings>
    <MasterTableView CommandItemDisplay="Top" AllowFilteringByColumn="false" AllowSorting="false" EditMode="Batch" EnableViewState="True" Width="100%" AutoGenerateColumns="false"
        CommandItemSettings-ShowCancelChangesButton="false" CommandItemSettings-ShowSaveChangesButton="false" CommandItemSettings-ShowRefreshButton="false"
        NoMasterRecordsText="" ShowHeader="false">
        <EditFormSettings EditFormType="AutoGenerated" EditColumn-ButtonType="PushButton" />
        <Columns>
            <telerik:GridTemplateColumn HeaderText="Task" HeaderStyle-Width="150px" DataField="lfaNum" UniqueName="lfaNum">
                <ItemTemplate>
                    <a target='_blank'  href='XXX.aspx?Num=<%# Eval("lfaNum")  %>'><%# Eval("lfaNum")  %></a>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox ID="cboKAC" DataTextField="lfaNum" DataValueField="lfaID" DataSourceID="dsLFA"
                        DropDownAutoWidth="Enabled" Filter="Contains" runat="server"
                        EnableAutomaticLoadOnDemand="True" ItemsPerRequest="20" ShowMoreResultsBox="true" EnableVirtualScrolling="true" CausesValidation="false">
                    </telerik:RadComboBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" ButtonType="ImageButton" UniqueName="DeleteButton" HeaderStyle-Width="30px" />
        </Columns>
    </MasterTableView>        
</telerik:RadGrid>

 

Alex Dybenko
Top achievements
Rank 2
 asked on 04 Mar 2024
0 answers
48 views

Hi All,

We are using the below code for xlsx format export using the Telerik.Web.UI.dll.

  "gridControl.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;"

Is that enough to work in production? and advice if we purchase the DevCraft Ultimate, will it be working fine?

Dev
Top achievements
Rank 1
 asked on 01 Mar 2024
0 answers
29 views

I need to get a reference to a telerik control contained in the commanditemtemplate of a radgrid using javascript.

Given the following:


<CommandItemTemplate>
<asp:Table>
<asp:TableRow>
<asp:TableCell>
<telerik:RadComboBox runat=server ID="RadComboBox_CommandItem">


How would I get the reference to the ComboBox?

 

I've tried window.$find, $telerik.findControl and $telerik.findElement, but I keep getting a " CS0103: The name 'RadComboBox_CommandItem' does not exist in the current context"

ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
 asked on 27 Feb 2024
0 answers
32 views

I have a fairly standard data grid


<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center" Skin="Default">
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1">
	<asp:UpdatePanel ID="UpdatePanel2" runat="server">    
		<ContentTemplate>
		<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" EnableViewState="true" AutoGenerateColumns="false" Height="100%"
			AllowSorting="true" GroupingEnabled="false" EnableLinqExpressions="false" AllowCustomSorting="true"
			EnableHeaderContextMenu="false" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection="true" AllowPaging="false">
			<MasterTableView TableLayout="Fixed" ClientDataKeyNames="ID" AllowCustomPaging="true" AllowPaging="True" PageSize="50"/>
			<ClientSettings EnableRowHoverStyle="true">
				<Virtualization EnableVirtualization="true" InitiallyCachedItemsCount="50"
					LoadingPanelID="RadAjaxLoadingPanel1" ItemsPerView="50" RetrievedItemsPerRequest="50"/>
				<Scrolling AllowScroll="true" UseStaticHeaders="true"/>
				<Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true"/>
				<Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true" CellSelectionMode="None" />
				 <ClientEvents OnKeyPress="KeyPress" />
			</ClientSettings>
			<PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadDropDownList" CssClass="TelerikPager"/>
		</telerik:RadGrid>
		</ContentTemplate>
	</asp:UpdatePanel>
</telerik:RadAjaxPanel>

I have 1007 items to show. Everything work fine, until I get to the last page, be it with scroll, clicking next pages, or jump to end button. For the last page (page 21, so index 20) the Grid in RadGrid1_NeedDataSource on it's MasterTableView.CurrentPageIndex has 19. So I return the wrong portion of the data.

Is something set up wrong or is there some other issue?

Up until that point everything is great, for page 19, index is 18, for 20 index is 19, and then for 21 it's again 19.

There is no rebind happening in the code and there is nothing really interesting happening on the server side code.

 

Valent
Top achievements
Rank 1
 asked on 22 Feb 2024
0 answers
25 views
I have a Windows 11 machine with a Logitech mouse.  When I have the mouse pointer within a RadGrid, I can turn the mouse wheel to scroll the grid contents vertically and I can hold down the SHIFT key and turn the mouse wheel to scroll the grid contents horizontally.  Alternatively, I can hold the mouse wheel down and move the mouse to scroll the contents vertically or horizontally.  As soon as I freeze columns in the RadGrid, I lose the ability to scroll horizontally with the mouse wheel.

The issue can be demonstrated on the Telerik Web UI Grid Scrolling Demo page by enabling/disabling frozen columns.

Is this something that can be looked into?

Regards,
Dave
David
Top achievements
Rank 1
 asked on 13 Feb 2024
0 answers
33 views

I have a bound grid that contains an image.  Since the image is about the size of a thumbnail...I want to give the user the ability to click the image and have it displayed in full.  I figured a good way to do this would be to use a RadLightBox.  Am I barking down the right path?  Is there a better way?  


                        <telerik:RadGrid ID="rgMain" runat="server" Width="100%" AutoGenerateColumns="False">
                            <MasterTableView EditMode="PopUp" ShowHeadersWhenNoRecords="True" EnableNoRecordsTemplate="True" DataKeyNames="RaceID" CommandItemDisplay="Top">
                                <CommandItemSettings ShowRefreshButton="False" ShowAddNewRecordButton="False" />
                                <Columns>
                                    <telerik:GridBoundColumn UniqueName="RaceName" DataField="RaceName" HeaderText="Race Name"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="SeriesName" DataField="SeriesName" HeaderText="Series"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="RaceDesc" DataField="RaceDesc" HeaderText="Description"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn UniqueName="RaceDate" DataField="RaceDate" HeaderText="Date" DataFormatString="{0:MM/dd/yyyy}"></telerik:GridBoundColumn>
                                    <telerik:GridHyperLinkColumn DataNavigateUrlFields="RaceRegLink" HeaderText="Registration Link" DataTextField="RaceRegLink" Target="_blank"></telerik:GridHyperLinkColumn>
                                </Columns>
                                <DetailTables>
                                    <telerik:GridTableView Name="Members" DataKeyNames="MemberID,RaceID" ClientDataKeyNames="MemberID,RaceID" Width="100%" ShowFooter="True">
                                        <ParentTableRelation>
                                            <telerik:GridRelationFields MasterKeyField="RaceID" DetailKeyField="RaceID" />
                                        </ParentTableRelation>
                                        <NoRecordsTemplate>No records to display.</NoRecordsTemplate>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="Member" UniqueName="Member">
                                                <ItemTemplate>
                                                    <telerik:RadBinaryImage ID="imgProfPic" runat="server" ImageUrl="~/images/ProfilePicBlank.jpg" Height="50px" Width="50px"
                                                        ResizeMode="Fit" DataValue='<%# IIf(Eval("ProfPic") IsNot DBNull.Value, Eval("ProfPic"), New System.Byte(-1) {})%>'
                                                        AlternateText='<%# Eval("MemberID") %>' />
                                                    <asp:Label runat="server" Text='<%# Eval("FullName") %>'></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn UniqueName="Division" DataField="Division" HeaderText="Division"></telerik:GridBoundColumn>
                                        </Columns>                                        
                                        <HeaderStyle Font-Bold="True" BackColor="Silver" />
                                    </telerik:GridTableView>
                                </DetailTables>                                
                                <NoRecordsTemplate>
                                    No records to display.
                                </NoRecordsTemplate>
                                <HeaderStyle Font-Bold="True" BackColor="#CCCCCC" />
                            </MasterTableView>
                        </telerik:RadGrid>

SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 asked on 28 Dec 2023
0 answers
34 views

Hello,

I have a grid that could be grouped by one of the columns or ungrouped. GroupLoadMode = "Client".

What is the easiest way to get the grouping state (grouped or ungrouped) of the grid on the client side.

Thanks,

Olga

Olga
Top achievements
Rank 1
Iron
 asked on 05 Dec 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?