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

Hello,

 I have a RadGridview and a RadScheduler on the same page. Can I drag a row from the gridview to the scheduler and have it added? I think I read that drag/drop is not available yet but someone posted code for a workaround. Could something be done for this to work? I'm wondering if I could select a row in the gridview and have the row number or a key field  data in a sesion variable and then have some event on the scheduler I could just move it by code myself. Or even if drag/drop was not supported can I still get an event fired for the scheduler to know when I was trying to drop on it and know the time so I could manually do it?

Thanks,

Warren

 

Warren
Top achievements
Rank 1
 answered on 05 Feb 2016
5 answers
105 views
HI

I found a small problem while implementating Cascading ComboBoxes : 

ComboBox - Cascading ComboBoxes
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

The ComboBox Items example as below :

1.Eastern-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
2.Western-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
3.Northern-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
4.Southern-1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ

First dropdown the combobox, you'll see that the item was wrapped to 2 lines automatically,
then select 1.Eastern-... then move the caret to LMN position.

Second dropdown the combox and select 2.Western-... you'll find that the carent still focus on LMN position.

The problem is - Could RadComboBox focus to first character automatically after selection ? 
When RadComboBox with long string items, users will confused if long string is ends with spaces.

In Sample.mdf you can find the table dbo.Region, the value of RegionDescription is ends with a long space string :

"Eastern                                           "
"Western                                           "
...
(see C:\Program Files\Telerik\UI for ASP.NET MVC Q3 2015\wrappers\aspnetmvc\Examples\VS2012\Kendo.Mvc.Examples\App_Data\Sample.mdf )

Maybe I can set RadComboBox.DropDownWidth to larger value 
but when user dropdown/select then move the carent to LMN position the problem is still the same.

Best regards

Chris
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
 answered on 05 Feb 2016
2 answers
81 views

Hi,

 

In the following example I'm trying to update a grid based on changes made to Gantt fields.

protected void RadGantt1_OnTaskUpdate(object sender, TaskEventArgs e) {
     gridProjects.DataBind();
}

It does not work as expected. Seems like the bound data source has not updated yet so grid still picks up old data. Is there something like an "AfterTaskUpdate" event?

Thank you.

Dan
Top achievements
Rank 1
 answered on 04 Feb 2016
1 answer
105 views

Hi, In the RadComboBox I specified the LoadingMessage = "Please Wait...".  But a vertical scroll appears in the right side of this load message.  

It doesn't seem appropriate to show the vertical arrows when this load message is displayed.  I'd rather just show the vertical scrolls in the dropdown once data is loaded to allow the user to scroll the results.

Also, is there a way to customize the size of the message's box or container?

Thanks

Hristo Valyavicharski
Telerik team
 answered on 04 Feb 2016
8 answers
229 views
Hello,

I have a RadGantt control and a RadDropDownTree which contains the different tasks of the gantt control (for displaying the assigned resources depending on the selection of the dropdowntree). Both controls are in different RadAjaxPanels. The update of the tasks inside the gantt is performed inside the "OnTaskUpdate" event. Now I want to achive that if the user changes e.g. the title of the task, the dropdowntree should be updated as well. Can somebody help how to do that?

Regards,
Felix
Dan
Top achievements
Rank 1
 answered on 04 Feb 2016
3 answers
764 views
I'm having an issue with the Aggergate="Sum"  I have a bunch of invoices with fees on them.  I needs to display the data grouped by invoice and show the total of the fees in the group header along with a Grand total in the footer of the entire grid. 

I'm using the following markup to do that.  The issue is that when I include the SUM for the grand total in the footer.  The Group header will only show the value of the last item in that group.  The group header no longer rolls or sums up the fees in the group.

<telerik:RadGrid ID="rgFees" runat="server" AutoGenerateColumns="false" ShowFooter="True"
    Skin="Web20" Height="500px">
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" GroupLoadMode="Client">
        <Columns>
            <telerik:GridBoundColumn DataField="FeeDescription" HeaderText="Fee Description">
            </telerik:GridBoundColumn>
  
             <telerik:GridBoundColumn Aggregate="Sum" DataField="TotalFee" HeaderText="Total*"
                FooterText="Total" DataFormatString="{0:C}">
            </telerik:GridBoundColumn>      
  
            <telerik:GridBoundColumn DataField="InvoiceId" HeaderText="Invoice Number">
            </telerik:GridBoundColumn>
        </Columns>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="InvoiceId" HeaderText="" />
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="InvoiceId" HeaderText="  " HeaderValueSeparator="Invoice # " />
                    <telerik:GridGroupByField FieldName="TotalFee" HeaderText="            "
                        HeaderValueSeparator="Total: " Aggregate="Sum" FormatString="{0:C}" />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="false" />
    <GroupingSettings ShowUnGroupButton="false" />
</telerik:RadGrid>





The following Code works and gives the correct group header sum.  How do I get a GRAND TOTAL to show up in the footer for the entire grid.



<telerik:RadGrid ID="rgFees" runat="server" AutoGenerateColumns="false" ShowFooter="True"
    Skin="Web20" Height="500px">
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" GroupLoadMode="Client">
        <Columns>
            <telerik:GridBoundColumn DataField="FeeDescription" HeaderText="Fee Description">
            </telerik:GridBoundColumn>
  
             <telerik:GridBoundColumn   DataField="TotalFee" HeaderText="Total*"
                FooterText="Total" DataFormatString="{0:C}">
            </telerik:GridBoundColumn>      
  
            <telerik:GridBoundColumn DataField="InvoiceId" HeaderText="Invoice Number">
            </telerik:GridBoundColumn>
        </Columns>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="InvoiceId" HeaderText="" />
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="InvoiceId" HeaderText="  " HeaderValueSeparator="Invoice # " />
                    <telerik:GridGroupByField FieldName="TotalFee" HeaderText="            "
                        HeaderValueSeparator="Total: " Aggregate="Sum" FormatString="{0:C}" />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="false" />
    <GroupingSettings ShowUnGroupButton="false" />
</telerik:RadGrid>


Pavlina
Telerik team
 answered on 04 Feb 2016
25 answers
1.5K+ views
I am trying to get a confirmation dialog working when the user hit's "Update" button in a MasterEditTemplateForm template of a RadGrid.  The scenerio is working fine in all other respects.  I have followed the appropriate links, have the JavaScript in an external file and a container div working correctly that displays the dialog to the user. 

I can step into the JavaScript code and verify that OpenConfirm() dialog shows the correct message to the user, and can also verify that the return result is true or false based on the Ok or Cancel buttons clicked.

How can I fire the Grid's ItemCommand handler if the result of the dialog was yes?

function confirmCallBackFn(arg) {  
     return arg;  

function OpenConfirm(customTitle) {  
    return radconfirm('<h3><span style="color: #333399;">' + customTitle + '?</span></h3>', confirmCallBackFn, 330, 100, customTitle);  
    return false;  

<asp:Button ID="btnSave" runat="server" CommandArgument="PerformInsert" CssClass="ButtonStyle"   
                                                                                        Text="Insert" CommandName="PerformInsert" OnClientClick="javascript: if (OpenConfirm('Save Food Menu Item Editing')) {return true;}else{return false;}" /> 

The ItemCommand handler would normally validate the data entry and then call a boolean function to either insert or update data.  The result of that function closes or does not close the MasterEditTemplate form. 

I need to integrate the confirmation dialog into the project.  Any suggestions would be appreciated.

Thanks
Eyup
Telerik team
 answered on 04 Feb 2016
3 answers
281 views

Hi,

I have a RadGrid bound to WebAPI through RadClientDataSource. Grid is configured to fire the OnRowDataBound event on the client side. Pagination is set to TRUE and is configured to show 10 rows per page. The service returns 6 rows which bind the grid and on each row I bind a combobox inside that row with static data. (RadComboBox template column)

Issue - I presume the OnRowDataBound event must fire 6 times i.e. exactly equal to the number of rows bound to the grid, however its fired more than 6 times and hence the same dropdowns are appended with the data for all the extra times the rowbound event is called. I have to manually clear the items from the combo as a work-around.

This does not happen If I turn OFF pagination.

What am I missing here?

JavaScript - OnRowDataBound event

01.<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
02.   <script>
03.     function RowDataBound(sender, args) {
04.        var cmbOType = args.get_item().findControl("cmbOpportunityType");
05.        Populate(cmbOType);
06.     };
07. 
08.     function Populate(cmb) {
09.        cmb.clearItems();
10.        var otype = [
11.          { Value: "1", Text: "AMAR" },
12.          { Value: "2", Text: "VDB" },
13.          { Value: "3", Text: "MLS" }];
14. 
15.          for (var i = 0; i < otype.length; i++) {
16.            var cmbItem = new Telerik.Web.UI.RadComboBoxItem();
17.            cmbItem.set_value(otype[i].Value);
18.            cmbItem.set_text(otype[i].Text);
19.            cmb.get_items().add(cmbItem);
20.         }
21.    };
22.  </script>
23.</telerik:RadCodeBlock>

 

RadGrid

01.<telerik:RadGrid AllowFilteringByColumn="true"
02.    AllowSorting="true" AllowPaging="true"
03.    runat="server" ID="RadGrid1"
04.    PageSize="10"
05.    AutoGenerateColumns="false"
06.    ClientDataSourceID="RadClientDataSource1">
07.    <ClientSettings>
08.        <ClientEvents OnRowDataBound="RowDataBound" />
09.    </ClientSettings>
10.    <MasterTableView ClientDataKeyNames="ID">
11.        <Columns>
12.            <telerik:GridBoundColumn
13.                            UniqueName="ID"
14.                            DataField="ID"
15.                            HeaderText="ID"
16.                            ReadOnly="true" />
17.            <telerik:GridTemplateColumn UniqueName="OpType" AllowFiltering="false" HeaderText="Opportunity Type">
18.                <ItemTemplate>
19.                    <telerik:RadComboBox
20.                        runat="server"
21.                        ID="cmbOpportunityType"
22.                        OnClientSelectedIndexChanged="OnClientItemSelected">
23.                    </telerik:RadComboBox>
24.                </ItemTemplate>
25.            </telerik:GridTemplateColumn>
26. 
27.            <telerik:GridTemplateColumn
28.                UniqueName="EstimatedValue"
29.                HeaderText="Esitmated Value"
30.                AllowFiltering="false">
31.                <ItemTemplate>
32.                    <telerik:RadNumericTextBox
33.                        EnabledStyle-HorizontalAlign="Right"
34.                        runat="server"
35.                        ID="tEstimateValue">
36.                    </telerik:RadNumericTextBox>
37.                </ItemTemplate>
38.            </telerik:GridTemplateColumn>
39. 
40.            <telerik:GridTemplateColumn UniqueName="Name" DataField="Name" AllowFiltering="false">
41.                <ItemTemplate>
42.                    <telerik:RadTextBox runat="server" ID="tName"></telerik:RadTextBox>
43.                </ItemTemplate>
44.            </telerik:GridTemplateColumn>
45. 
46.            <telerik:GridTemplateColumn UniqueName="Shipped" DataField="Shipped" AllowFiltering="false">
47.                <ItemTemplate>
48.                    <telerik:RadDatePicker runat="server" ID="tDatePicker"></telerik:RadDatePicker>
49.                </ItemTemplate>
50.            </telerik:GridTemplateColumn>
51.            <telerik:GridClientDeleteColumn HeaderText="Delete" ButtonType="ImageButton" HeaderStyle-Width="70px">
52.            </telerik:GridClientDeleteColumn>
53.        </Columns>
54.    </MasterTableView>
55.</telerik:RadGrid>
56.<telerik:RadClientDataSource runat="server" ID="RadClientDataSource1"
57.    <DataSource>
58.        <WebServiceDataSourceSettings>
59.            <Select Url="api/products" RequestType="Get" />
60.        </WebServiceDataSourceSettings>
61.    </DataSource>
62.    <Schema>
63.        <Model ID="ID">
64.            <telerik:ClientDataSourceModelField FieldName="ID" DataType="Number" />
65.            <telerik:ClientDataSourceModelField FieldName="Name" DataType="String" />
66.            <telerik:ClientDataSourceModelField FieldName="Shipped" DataType="Date" />
67.        </Model>
68.    </Schema>
69.</telerik:RadClientDataSource>

Service returns 6 rows.

 

01.products = new List<Product>(new Product[]
02.{
03.    new Product { ID = 1, Name = "Product1", Category = "Category1", Price = 1.05M,Shipped=DateTime.Now },
04.    new Product { ID = 2, Name = "Product2", Category = "Category2", Price = 3.75M,Shipped=DateTime.Now  },
05.    new Product { ID = 3, Name = "Product3", Category = "Category2", Price = 2.34M,Shipped=DateTime.Now },
06.    new Product { ID = 4, Name = "Product4", Category = "Category3", Price = 1.63M,Shipped=DateTime.Now },
07.    new Product { ID = 5, Name = "Product5", Category = "Category4", Price = 5.62M,Shipped=DateTime.Now },
08.    new Product { ID = 6, Name = "Product6", Category = "Category1", Price = 7.68M,Shipped=DateTime.Now },
09.    /*new Product { ID = 7, Name = "Product7", Category = "Category1", Price = 8.23M,Shipped=DateTime.Now },
10.    new Product { ID = 8, Name = "Product8", Category = "Category2", Price = 9.44M,Shipped=DateTime.Now },
11.    new Product { ID = 9, Name = "Product9", Category = "Category2", Price = 0.43M,Shipped=DateTime.Now },
12.    new Product { ID = 10, Name = "Product10", Category = "Category3", Price = 2.12M,Shipped=DateTime.Now },
13.    new Product { ID = 11, Name = "Product11", Category = "Category4", Price = 1.79M,Shipped=DateTime.Now },
14.    new Product { ID = 12, Name = "Product12", Category = "Category4", Price = 4.22M,Shipped=DateTime.Now } */
15.});

** I have removed columns irrelevant to this issue.

 

Konstantin Dikov
Telerik team
 answered on 04 Feb 2016
3 answers
200 views

Hello, I have a pivot grid with an aggregate field that holds an average of percentages in the form of 100.0000 etc.

 I get numbers like 99.90356798455882352941176471

 I've tried "{0:P}", "{0}N %" but nothing works. What can I do? Is it a bug? It's a telerik version from 2013.

PivotGridAggregateField aggregateField = new PivotGridAggregateField();
RadPivotGrid1.Fields.Add(aggregateField);
aggregateField.DataField = "PercentOD";
aggregateField.UniqueName = "PercentOD";
aggregateField.Aggregate = PivotGridAggregate.Average;
aggregateField.DataFormatString = "{0:F2}";
aggregateField.TotalFormatString = "{0:F2}";

Eyup
Telerik team
 answered on 04 Feb 2016
1 answer
102 views
Is it possible to align the results of a ColumnSeries to be left aligned? My customer wants the results to have the same column width and be left aligned (even if there is only one result). I was able to use JavaScript to assign the gap property of the chart, but cannot seem to find anything on the alignment property. Maybe there is a CSS solution or a property I am missing?
Danail Vasilev
Telerik team
 answered on 04 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?