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

Hi,

My situation: I have a Radgrid with TooltipManager setup which works fine.

Now I have to place another RadGrid in the Tooltip which has an update button per row.
How would one configure so, that the Tooltip's RadGrid is updated in the Tooltip.
Please see attached screenshot...

Thanks for any pointers.

Marc

Vasko
Telerik team
 answered on 20 Feb 2024
1 answer
120 views

Hi,

Could you, please help me find code examples for how to format filter dropdown items of decimal and datetime fields(columns) in telerik:RadGrid.
We need a comma separator for decimal fields.  Also, there is a chance of negative values, so in that case, we need to show its absolute value(within parentheses).
In the case of datetime fields, we need only the date without the time part (date format will be different for different agencies).

We changed the format of Invoice Date column in  ItemDataBound event as below.

dataItem["Date"].Text = rowItem.Date.ToString(AgencyDateFormat);

But it only changed the grid column values, not the filter dropdown.(image of mentioned issue is given below)

We changed the format of Amount column in  ItemDataBound event as below.

dataItem["Amt"].Text = string.Format("{0:0,0.00;(0.00)}", rowItem.Amt);

But it only changed the grid column values, not the filter dropdown.(image of mentioned issue is given below)

 

What we need is for the values shown in the filter will be in the same format of the corresponding column.

I solved this issue by using following code:

private void RadGrid_GridFilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            string filterKey = e.Column.UniqueName;
            List<string> listOfItems = GetList(filterKey);

            foreach (var item in listOfItems)
            {
                if (e.Column.DataType == typeof(DateTime))
                {
                    DateTime datimeObj;
                    if (DateTime.TryParse(item, out datimeObj))
                    {
                        e.ListBox.Items.Add(new RadListBoxItem
                        {
                            Text = datimeObj.ToString(AgencyDateFormat),
                            Value = item
                        });
                        e.ListBox.DataTextFormatString = AgencyDateFormat;
                    }
                }
                else if (e.Column.DataType == typeof(decimal))
                {
                    decimal moneyObj;
                    if (decimal.TryParse(item, out moneyObj))
                    {
                        e.ListBox.Items.Add(new RadListBoxItem
                        {
                            Text = string.Format("{0:0,0.00;(0.00)}", moneyObj),
                            Value = item
                        });
                    }
                }
                else
                {
                    e.ListBox.DataSource = listOfItems;
                }
            }
            e.ListBox.DataBind();
        }

There is one more issue I'm facing. If the column contains a null or empty string, then I need to show them as "(Empty)" in the filter drop-down. How to do this?

We will appreciate your help.

Thanks

            
Vasko
Telerik team
 answered on 19 Feb 2024
0 answers
84 views
I have RadDatePicker in detail window for grid. I need to modify background color dynamically so I added new script to Calender like this:
datePicker.Calendar.ClientEvents.OnLoad = initMethodName;
Now I noticed that calendar is never destroyed from page. If I close detail window and open it again then initialization method is called twice.
It looks that table element with id "<ctrl_name>_calendar" is always there and never unloaded.

Can you help me how to dispose this object or remove event from it?

Thank you.
Petr
Top achievements
Rank 1
Iron
Iron
 asked on 16 Feb 2024
0 answers
114 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
1 answer
124 views

Hi,

Just started digging in to using the RadScheduler.

I am using Timeline view, GroupBy resource, and GroupingDirection Vertical.

There is a misalignment on the groupings.  Two issues I see...

1) The row lines for the resource do not align with the appointment horizontal lines

2) Some appointments look to align with the incorrect resource.  Appointment aaa-137 uses resource 137, but the block spans both 136 and 137 and it in fact looks to be assigned to 136.

 

How can I fix this?

Attila Antal
Telerik team
 answered on 05 Feb 2024
2 answers
143 views

I displayed a lot of charts which contains too many data. So I define XAxis.MaxValue and/or XAxis.MinValue at the beginning. User can use zooming and panning function if needed. But sometimes it is not clear that some part of chart is not visible and how many values are hidden. If I understand well then "Data Navigation" can be used only for date axis, but it is not true in most of my cases.

My idea is to display below chart "Range Slider" and simply show left and right boundary of the chart. At the beginning it will be enough just to display the position (after events drag/zoom). Later I want implement that user can change the zoom and position of chart by using the slider, but I am not sure if it is possible to modify chart by client methods.

Did anybody try to implement something like that or is there any similar functionality which I didn't noticed?

Thank you,

Petr

Petr
Top achievements
Rank 1
Iron
Iron
 answered on 02 Feb 2024
1 answer
188 views
Based on the documentation I've seen, the Avatar control is looking for a url for the image. Is there a way to display a binary image from a sql datasource instead?
Rumen
Telerik team
 answered on 02 Feb 2024
2 answers
252 views
Hi,

I am using Rad Tabstrip in my code, which is working fine with internet explorer but not working with firefox or chrome.
My firefox version is v3.0.8 where as my google chrome version is v1.0.154.53.
Please find below the code I am using and let me know the solution as most of my users use firefox.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="MemberPages_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link type="text/css" rel=Stylesheet href=MemberProps.css />
</head>

<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div style="left: 0px; width: 1024px; position: absolute; top: 60px; height: 708px">
            <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black" MultiPageID="RadMultiPage1"
                SelectedIndex="0" CssClass="tabStrip">
                <Tabs>
                    <telerik:RadTab Text="Details">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Education">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Skills">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage">
                <telerik:RadPageView ID="RadPageView1" runat="server">
                    <ul>
                        <li><label>Name:</label> John Smith</li>
                        <li><label>Birthday:</label> October 20th 1976</li>
                        <li><label>Marital Status:</label> Single</li>
                    </ul>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server" CssClass="pageViewEducation">
                    <p>
                        BSc (Hons) Computer Science MIT, Boston MA September 1994 - July 1998
                    </p>
                    <p>
                        Courses taken:
                    </p>
                    <ul>
                        <li><label>Computer Architecture:</label> [A+]</li>
                        <li><label>Programming:</label> [A]</li>
                        <li><label>Mathematics for Computing:</label> [A]</li>
                        <li><label>Database Specification:</label> [A]</li>
                        <li><label>Software Development:</label> [B+]</li>
                        <li><label>OO Software Development Project:</label> [B-]</li>
                        <li><label>Four Advanced OO Software Systems:</label> [A*]</li>
                        <li><label>Systems and Simulation:</label> [A-]</li>
                        <li><label>Computer Graphics:</label> [B+]</li>
                    </ul>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server">
                    <ul>
                        <li><label>Programming:</label> C#, JavaScript, C++, PHP</li>
                        <li><label>Web Technologies:</label> HTML, CSS, DHTML</li>
                        <li><label>Databases:</label> SQL Server 2005, MySQL, Access, Oracle</li>
                        <li><label>Operating Systems:</label> Windows, Linux, DOS</li>
                    </ul>
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </div>
    </form>
</body>
</html>

Thanks in advance.

Regards,
Sandeep Devagiri


Ersin
Top achievements
Rank 1
Iron
 answered on 02 Feb 2024
0 answers
89 views

I can't figure out how to use the Visual Studio Design View on the Scheduler Templates.

For example, on Gridview I can convert columns to templates and then view and edit these templates in the designer.

How do I do this for the different Templates for the Scheduler (e.g. AdvancedInsertTemplate and AdvancedEditTemplate) ?

Scott
Top achievements
Rank 1
Iron
Iron
 asked on 01 Feb 2024
2 answers
1.9K+ views
We're getting this error in the prerender event of the page with a grid:

Error message: Object reference not set to an instance of an object.

Stack trace:    at Telerik.Web.UI.RadComboBox.OnInit(EventArgs e)

   at System.Web.UI.Control.InitRecursive(Control namingContainer)

   at System.Web.UI.Control.AddedControl(Control control, Int32 index)

   at Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns)

   at Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)

   at Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead)

   at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)

   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)

   at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()

   at System.Web.UI.Control.EnsureChildControls()

   at Telerik.Web.UI.GridTableView.get_Items()

   at Telerik.Web.UI.GridTableView.GetSelectedItems()

   at XXX.StudentSearch_PreRender(Object sender, EventArgs e) in C:\XXX\StudentSearch.aspx.vb:line 140

   at System.EventHandler.Invoke(Object sender, EventArgs e)

   at System.Web.UI.Control.PreRenderRecursiveInternal()

   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Private Sub StudentSearch_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
        If grd.MasterTableView.GetSelectedItems.Count > 0 And grd.Visible Then
            tab.Visible = True
            mp.Visible = True
        Else
            tab.Visible = False
            mp.Visible = False
        End If
    End Sub
The error is occurring in the GetSelectedItems call. I had originally used the SelectedItems, but was getting an error with that occasionally, so I switched to GetSelectedItems. The error doesn't always happen, so it's not something I can easily reproduce.

Below is the definite for the RadGrid:
<telerik:RadGrid ID="grd" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                    GridLines="None" AllowPaging="True" PageSize="20" Width="600px">
                    <ClientSettings>
                        <Selecting AllowRowSelect="False" />
                    </ClientSettings>
                    <MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerOnDemand"
                        DataKeyNames="StudentUID">
                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridButtonColumn CommandName="Select" FilterControlAltText="Filter column column"
                                Text="Open" UniqueName="column" ButtonType="ImageButton" ImageUrl="Images/Open.gif">
                                <ItemStyle Width="20px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="StudentID" FilterControlAltText="Filter column1 column"
                                HeaderText="Student ID" UniqueName="column1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LastName" FilterControlAltText="Filter column2 column"
                                HeaderText="Last Name" UniqueName="column2">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FirstName" FilterControlAltText="Filter column4 column"
                                HeaderText="First Name" UniqueName="column4">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Middle" FilterControlAltText="Filter column3 column"
                                HeaderText="Middle" UniqueName="column3">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>
                </telerik:RadGrid>


Attila Antal
Telerik team
 answered on 01 Feb 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?