Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
1.0K+ views

I have a radhtmlchart using BarSeries with one data series.  The data is sourced from a linq query, not generated directly in codebehind like the demo for colorizing bars shows.  What I would like to do is colorize the bars depending on a second value in the results of the query.

The top of the chart code is straightforward.  I'm leaving out non-relevant code but let me know if there's something else you need to see.

            <telerik:RadHtmlChart ID="BarChart1" runat="server">
                <PlotArea>
                    <Series>
                        <telerik:BarSeries DataFieldY="DailyGrossQty" Name="Daily Gross Qty" Visible="true" Stacked="false" gap=".4" spacing="0.4">
                            <Appearance>
                                <FillStyle BackgroundColor="#145e8e"></FillStyle>
                            </Appearance>
                        </telerik:BarSeries>

 

The linq query is also straightforward:

            var x = from Z in db.spDailyData(ReportDate)
                    select Z;

           BarChart1.DataSource = x.OrderByDescending(o => o.DailyGrossQty).Take(25);

There is another field in the stored procedure called 'Division' and I would like to conditionally color the bars based on the value there, overriding the default.

What would be the simplest approach to that?

Thanks.

-Dan

 

 

Vessy
Telerik team
 answered on 10 Jun 2019
3 answers
273 views
Hey guys,

I am using LoadOnDemand throughout this app in all my RadComboBox instances... Here is an example...

 

<telerik:RadComboBox ID="rcProject" Runat="server" AllowCustomText="false"

 

 

 

AutoPostBack="True" EmptyMessage="Type a Project Name"

 

 

 

EnableLoadOnDemand="True" EnableVirtualScrolling="True" Filter="StartsWith"

 

 

 

Height="22px" MaxHeight="200px" OnItemsRequested="rcProject_ItemsRequested"

 

 

 

ShowMoreResultsBox="true"

 

 

 

ToolTip="You can type or scroll and select. What you type, must exist in the list"

 

 

 

Width="200px">

 

 

 

</telerik:RadComboBox>

 

 


My issue is that once a value is selected in this combobox, once the user clicks on the combobox to select another item... the previously selected item is the only thing showing up in the list... because of the item selected is a match...

I have tried to clear the text, value of the combobox in the rcProject_ItemsRequested event handler but not able to get it to clear... The text is still there. Could you help me with a client side workaround? I have seen some other posts but unable to implement anything, I keep getting Object is null...

Thanks much,

Sergiu Pascutiu
Dave
Top achievements
Rank 1
 answered on 07 Jun 2019
1 answer
123 views

In the Radscheduler I have the grid divided every 30 minutes. but if for example I have a 2-hour appointment, it fills the slot with a single appointment. How do I leave the 30-minute split even when entering long appointments?

 

Peter Milchev
Telerik team
 answered on 07 Jun 2019
2 answers
686 views

How can I set the border style of the row on HoverRow?

I can set the back color no problem.

But, any change to the border does not seem to have any effect.

 

In<ClientSettings> of grid I set EnableRowHoverStyle="true" 

 

Then is style section I have css:

<style type="text/css">
         div.RadGrid .rgHoveredRow
         {
           background-color:#ff0000 !important;  /* this works */
           border-width:thick !important;    /* no effect */
           border-right-color:black !important;/* no effect */
         }    
    </style>

Attila Antal
Telerik team
 answered on 07 Jun 2019
2 answers
585 views

     I have a user control with a RadGrid in my applicaiton.

 

The RadGrid fills properly by binding a datatable to the grid.  It shows properly on the screen with data.

 

Once I try to Sort or group, I am getting this error:

 

Any suggestions would be appreciated.  I am on Version 2019.2.514.40 of Telerik asp.net controls.

 

Unable to cast object of type 'ASP.masterpages_main_master' to type 'Telerik.Web.UI.GridTableView'.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidCastException: Unable to cast object of type 'ASP.masterpages_main_master' to type 'Telerik.Web.UI.GridTableView'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[InvalidCastException: Unable to cast object of type 'ASP.masterpages_main_master' to type 'Telerik.Web.UI.GridTableView'.] Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +3585 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9884270 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

 

Thanks,

 

Rog

Vessy
Telerik team
 answered on 07 Jun 2019
13 answers
775 views
Hi
  I am building a web application which contains list of grids in different area's. All have export options working fine but there is one grid which Export blank CSV even there is record. I have tried every possible option  but no output. Any help would be appreciated. this is the HTML code.

 

<telerik:RadGrid ID="radGridSelectUser" runat="server" Skin="Office2007"

 

 

AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"

 

 

AllowMultiRowSelection="true" Width="99%" >

 

 

<GroupingSettings CaseSensitive="false" />

 

 

<ExportSettings OpenInNewWindow="true">

 

 

<Pdf FontType="Link" PaperSize="A4" />

 

 

<Excel Format="Html" />

 

 

<Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" />

 

 

</ExportSettings>

 

 

<ClientSettings>

 

 

<Selecting AllowRowSelect="true" />

 

 

</ClientSettings>

 

 

 

<MasterTableView >

 

 

<PagerTemplate>

 

 

<!-- This is my custom footer-->

 

 

 

 

 

<uc1:gridFooter ID="gridFooter" runat="server" />

 

 

</PagerTemplate>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" DataField="Username" SortExpression="Username" FilterControlWidth="95%" >

 

 

<ItemTemplate>

 

 

<asp:LinkButton runat="server" ID="lnkUserName" OnClick="lnkUserName_Click" ToolTip='<%# DataBinder.Eval(Container.DataItem,"Username")%>' CommandName="SELECT" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"UserId")%>' Text='<%# DataBinder.Eval(Container.DataItem,"Username")%>'></asp:LinkButton>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 



Code Behind on Button Click

// There are mostly records between 2- 10

radGridSelectUser.ExportSettings.ExportOnlyData =

true;

 

radGridSelectUser.ExportSettings.IgnorePaging =

true;

 

radGridSelectUser.ExportSettings.OpenInNewWindow =

true;

 

radGridSelectUser.MasterTableView.ExportToCSV();


Best Regards

 

Rizwan Bashir

 

Jeff
Top achievements
Rank 1
 answered on 05 Jun 2019
13 answers
204 views

Hi,

I am getting a WebResource.axd 404 with the query string "P1cfbt_tMqMFRD7W.....asPNRfcrST-9miVNk1". When decrypted it says "pTelerik.Web.UI.Skins|Telerik.Web.UI.Skins.Windows7.Grid.sprite.png". All my other skins and sprites are loading properly. I have been through the telerik documentation discussing skins and WebResource.axd issues to no avail. 

Any help would be appreciated.

Thanks,

Mike

Allen
Top achievements
Rank 2
Iron
Veteran
 answered on 05 Jun 2019
2 answers
139 views

I am changing some fields in my grid through javascript. Unfortunately OnBatchEditCommand can't sense that anything changed at all.

Is there a way to trick grid to include changed fields in "new values"

Thank you

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 04 Jun 2019
3 answers
282 views

I have a grid where I am using the EditFormsettings and a user control.  The code looks like the following

 

      <EditFormSettings UserControlName="~/TemplateUserControls/EditControls/GroupEditFormControl.ascx" EditFormType="WebUserControl">
            <EditColumn UniqueName="GroupEditFormControl">
            </EditColumn>
            <PopUpSettings Modal="true" />
        </EditFormSettings>

I have the client event set to call a javascript function to center the user control

  <ClientSettings>

        <ClientEvents OnRowDblClick="RowDblClick" OnPopUpShowing="onPopUpShowing" />
    </ClientSettings>

 

And the Javascript looks like the following.  

<script type="text/javascript">
        function onPopUpShowing(sender, eventArgs) {

                var myWidth = 0, myHeight = 0;
                if (typeof (window.innerWidth) == 'number') {
                    //Non-IE
                    myWidth = window.innerWidth;
                    myHeight = window.innerHeight;
                } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                    //IE 6+ in 'standards compliant mode'
                    myWidth = document.documentElement.clientWidth;
                    myHeight = document.documentElement.clientHeight;
                } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    //IE 4 compatible
                    myWidth = document.body.clientWidth;
                    myHeight = document.body.clientHeight;
                }
               
                popUp = eventArgs.get_popUp();
                var gridWidth = myWidth;
                var gridHeight = myHeight;
                var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
                var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
                popUp.style.left = ((gridWidth - popUpWidth) / 2) +  "px";
                popUp.style.top = ((gridHeight - popUpHeight) / 2) + "px";        

       }

    </script>

 

The problem is no matter that values go into the Popup.style.left and popup.style.top values, the usercontrol is always in the same location.    I have confirmed that the Javascript is being called by putting a few "alert" calls 

For a quick test, I hard coded the top and left values (See below) to see if the user control would be at the top part of the screen

popUp.style.left = "10px";
popUp.style.top = "10px";

And the usercontrol's position did not move.

How can I center the usercontrol when using the editform function under the grid?

Attila Antal
Telerik team
 answered on 04 Jun 2019
2 answers
135 views
I'm trying to implement bootstrap 3 on my existing project.  radgrid with popup edit form works fine with PopUpShowing script found in this forum, shows as centered on page without bootstrap. But when I put radgrid to bootstrap grid cell, popup edit form shows on funny places. This happens when I have 2 columns (on bootstrap row) and grid placed to right column. As I see if I place grid to leftmost column it can calculate and set left of popup edit window.

Looks like edit popup windows stays in bootstrap cell and repositioning always start from left of this cell.

Strange thing is I also have delete confirmation dialog and this dialog centers on page perfectly.

Obviously I don't have enough knowledge. Can anyone help me please ?

Best..
Attila Antal
Telerik team
 answered on 03 Jun 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?