Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
306 views

Hi

Just need some help converting a VB grid to C#.

Binding is to a datatable deserialised from JSON using NewtonSoft.Json library.

I have the following line in VB that works OK:

If e.Appointment.DataItem("UsageType") = 1 Then...

However the same line in C# 

if (e.Appointment.DataItem("UsageType") == 1) {

Errors with a red squiggle under DataItem with the following text:-

SchedulerEventArgs does not contain a definition for Dataitem and no extension method DataItem accepting a first argument of type SchedulerEventArgs could be found.

I have the following using statements:

using Telerik.Web.UI;
using Telerik.Web;
using System.Data;

 

Konstantin Dikov
Telerik team
 answered on 14 Apr 2016
1 answer
164 views

Hi,

I am having some issue with the RadDropDownTree.

After I select a node on the RadDropDownTree, the property rddt.SelectedText sometimes displays the rddt.EmbeddedTree.SelectedNode.Text multiple times.

Please see attached image.

 

Nencho
Telerik team
 answered on 14 Apr 2016
1 answer
322 views

Hi

I am using a RADBUTTON in the itemtemplate of Radlistview.

Kindly let me know how to add the click-event for that RADbutton on server-side and perform the below operations

1) While clicking the RADBUTTON, : Need to store the bookid of the selected item in the Session 

2) Then redirect to cartpage.aspx (After storing the id in the session)

Pls guide how to achieve this scenario

 

            <telerik:RadListView ID="RadListView1" runat="server" ItemPlaceholderID="ProductItemContainer"

                DataKeyNames="BookID"  OnNeedDataSource="RadListView1_NeedDataSource" >
                <LayoutTemplate>
                    <fieldset>
                           <table>
  <tr>
<td>
<asp:Panel ID="ProductItemContainer" runat="server">
</asp:Panel>                                
</td>

</tr>
</table>
</fieldset>
</LayoutTemplate>
<ItemTemplate>
<fieldset>

<table>
<tr>
<td class="productItem">
    <a href="default2.aspx?isbn=<%# Eval("BookID")%>">
<img src="<%# Eval("imageurl")%>" alt="#= BookName #" />
                                   </a>
</td>

</tr>
<tr>
<td>
 <%# Eval("BookName")%> 
</td>
</tr>
<tr>
<td>
<telerik:RadButton CommandName="Button1" ID="BtnAddtoCart" runat="server" Text="Add to Cart"></telerik:RadButton>
</td>
</tr>
</table>
</fieldset>
</ItemTemplate>
</telerik:RadListView>
      

 

Eyup
Telerik team
 answered on 14 Apr 2016
1 answer
49 views
Hi! I have a bar serie graph and linear serie graph in a rad html chart, the user can modify the values of the liner serie graph its possible I update by code the values of only linear bar but the radhhtml chart updatse both the graph and linear bar is possible only update the linear serie graph?
Danail Vasilev
Telerik team
 answered on 14 Apr 2016
4 answers
112 views

Hi, 

We found few issues related to Export to Excel ...

1. Group Totals are not appearing in Excel output. We have tested both ExcelML and BIff... Group Header and Grand total row appear in Excel but Group totals not appear. We have not set any GroupFooter template and expect simple total should appear.

2. We are getting Excel Sheets without formatting. Is there any easy way that Excel should get same formatting as it view like Winform grid.

     If not then what is the generic way to format it, as we are creating single Viewer for different grid based report - generated dynamically thru code and placed on Asp form.  

3.While adding Java script for handling Double click Event, we found a solution to use Client Side Event RowDbClick ... which pass args..
    in that ars._datakeyvalues.Id    (ClientKeyName)  ... now the problem is that we have same asp page used as viewer for different kind of grid based reports.
    each have different fields .... We can set ClientKeyNames thru code but how to make this Java script dynamic... 
    In one Report we have Id field, in Second report we have ProductId .... This makes difficult to pass different key thru clientside event..

 

 

 

 

devoas
Top achievements
Rank 1
 answered on 14 Apr 2016
1 answer
359 views

I use 2 SqlDataSource to my RadGrid. The GridAttachmentColumn get AttachmentData from SqlDataSource3 and the rest of the grid from SqlDataSource1

Byt the FileNameTextField and DataTextField gets the Imagename from SqlDataSource1. How get i all from SqlDataSource3 AttachmentDataField, FileNameTextField and DataTextField?

 

<telerik:GridAttachmentColumn SortExpression="ImageName" UploadControlType="RadAsyncUpload" DataSourceID="SqlDataSource3" MaxFileSize="20971520" AllowedFileExtensions="jpg,jpeg,png,gif"
    EditFormHeaderTextFormat="Ladda upp bild:" AttachmentDataField="ImageData" ButtonType="ImageButton" ImageUrl="../images/thumb/images.gif"
    AttachmentKeyFields="ID" FileNameTextField="ImageName" DataTextField="ImageName" UniqueName="ImageColumn" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="33px">
</telerik:GridAttachmentColumn>

 

Kostadin
Telerik team
 answered on 14 Apr 2016
8 answers
187 views

(question from a noob)

I'm stuck, and couldn't find my answer. So here it goes:

I made a grid with  (w/ one detail or child table). I utilized the auto update, add and delete options but it only works with the child table. The parent one doesn't seem to update nor delete any record at all.

Can't seem to follow the demo too.Any direction is appreciated!

<asp:Panel ID="Panel1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadFormDecorator RenderMode="Lightweight" runat="server" DecorationZoneID="demo" EnableRoundedCorners="false" DecoratedControls="All" />
    <div id="demo" class="demo-container no-bg">
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GroupPanelPosition="Top" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" Skin="Black" GroupingSettings-GroupContinuesFormatString=" Group continues on the next page." MasterTableView-CommandItemDisplay="Top" EditItemStyle-HorizontalAlign="Right" MasterTableView-EditMode="EditForms" MasterTableView-EnableColumnsViewState="True" GroupingSettings-GroupSplitDisplayFormat="Showing {0} of {1} items." AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
            <MasterTableView DataKeyNames="JobFunction" DataSourceID="SqlDataSource1" AutoGenerateColumns="False">
 
                <DetailTables>
                    <telerik:GridTableView runat="server" DataKeyNames="EmployeeIndex" DataSourceID="SqlDataSource2" CommandItemDisplay="Top">
                        <ParentTableRelation>
                            <telerik:GridRelationFields MasterKeyField="JobFunction" DetailKeyField="JobFunction"></telerik:GridRelationFields>
                        </ParentTableRelation>
 
                        <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                        </EditFormSettings>
                    </telerik:GridTableView>
                </DetailTables>
 
                <CommandItemSettings AddNewRecordText="Add New Function" ShowExportToExcelButton="True" ShowExportToPdfButton="True"></CommandItemSettings>
                <Columns>
                    <telerik:GridClientDeleteColumn FilterControlAltText="Filter column column" UniqueName="column"></telerik:GridClientDeleteColumn>
                    <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="JobFunctionIndex" ReadOnly="True" HeaderText="JobFunctionIndex" SortExpression="JobFunctionIndex" UniqueName="JobFunctionIndex" DataType="System.Int32" FilterControlAltText="Filter JobFunctionIndex column"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="JobFunction" HeaderText="JobFunction" SortExpression="JobFunction" UniqueName="JobFunction" FilterControlAltText="Filter JobFunction column"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" UniqueName="Description" FilterControlAltText="Filter Description column"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Profile1" HeaderText="Profile1" SortExpression="Profile1" UniqueName="Profile1" FilterControlAltText="Filter Profile1 column"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Profile2" HeaderText="Profile2" SortExpression="Profile2" UniqueName="Profile2" FilterControlAltText="Filter Profile2 column"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
 
        <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:SiteSqlServer %>' SelectCommand="SELECT * FROM [Bak-JobFunction]" DeleteCommand="DELETE FROM [Bak-JobFunction] WHERE [JobFunctionIndex] = @JobFunctionIndex" InsertCommand="INSERT INTO [Bak-JobFunction] ([JobFunction], [Description], [Profile1], [Profile2]) VALUES (@JobFunction, @Description, @Profile1, @Profile2)" UpdateCommand="UPDATE [Bak-JobFunction] SET [JobFunction] = @JobFunction, [Description] = @Description, [Profile1] = @Profile1, [Profile2] = @Profile2 WHERE [JobFunctionIndex] = @JobFunctionIndex">
            <DeleteParameters>
                <asp:Parameter Name="JobFunctionIndex" Type="Int32"></asp:Parameter>
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter>
                <asp:Parameter Name="Description" Type="String"></asp:Parameter>
                <asp:Parameter Name="Profile1" Type="String"></asp:Parameter>
                <asp:Parameter Name="Profile2" Type="String"></asp:Parameter>
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter>
                <asp:Parameter Name="Description" Type="String"></asp:Parameter>
                <asp:Parameter Name="Profile1" Type="String"></asp:Parameter>
                <asp:Parameter Name="Profile2" Type="String"></asp:Parameter>
                <asp:Parameter Name="JobFunctionIndex" Type="Int32"></asp:Parameter>
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>
</asp:Panel>
 
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString='<%$ ConnectionStrings:SiteSqlServer %>' DeleteCommand="DELETE FROM [Bak-Employee] WHERE [EmployeeIndex] = @EmployeeIndex" InsertCommand="INSERT INTO [Bak-Employee] ([NameFirst], [NameMiddle], [JobFunction]) VALUES (@NameFirst, @NameMiddle, @JobFunction)" SelectCommand="SELECT [EmployeeIndex], [NameFirst], [NameMiddle], [JobFunction] FROM [Bak-Employee] WHERE ([JobFunction] = @JobFunction)" UpdateCommand="UPDATE [Bak-Employee] SET [NameFirst] = @NameFirst, [NameMiddle] = @NameMiddle, [JobFunction] = @JobFunction WHERE [EmployeeIndex] = @EmployeeIndex">
    <DeleteParameters>
        <asp:Parameter Name="EmployeeIndex" Type="Int32"></asp:Parameter>
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="NameFirst" Type="String"></asp:Parameter>
        <asp:Parameter Name="NameMiddle" Type="String"></asp:Parameter>
        <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter>
    </InsertParameters>
    <SelectParameters>
        <asp:SessionParameter SessionField="JobFunction" DefaultValue="JobFunction" Name="JobFunction" Type="String"></asp:SessionParameter>
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="NameFirst" Type="String"></asp:Parameter>
        <asp:Parameter Name="NameMiddle" Type="String"></asp:Parameter>
        <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter>
        <asp:Parameter Name="EmployeeIndex" Type="Int32"></asp:Parameter>
    </UpdateParameters>
</asp:SqlDataSource>

Konstantin Dikov
Telerik team
 answered on 14 Apr 2016
1 answer
45 views

Hi,
I have few combo boxes in the page with checkbox enabled. The combo item text is not showing up initially when the page loads. I have a reset button in the page, on which I just clear the selections of combo. After reset click, all the items are showing as expected. If i disable the checkbox for a combo box, then the combo item text is showing correctly during the initial load itself. Not sure what is wrong with the code ?

<telerik:RadComboBox ID="LevelMultiList" runat="server" DropDownWidth="320px" AutoCompleteSeparator=";" CheckBoxes="True"  CssClass="id-LevelMultiList" EmptyMessage=" " HighlightTemplatedItems="true" AccessibilityMode="true">
     <ExpandAnimation Type="OutBack" Duration="300" />
     <CollapseAnimation Type="InBack" Duration="200" />
</telerik:RadComboBox>

 

Thanks

Kumaran

Eyup
Telerik team
 answered on 14 Apr 2016
3 answers
323 views

The radgrid below is a shorter version of the one I'm working on.  I need to make "CYF_UNITS_JAN" ReadOnly by code behind.

Note the EditMode of the grid is Batch and EditType is Row.

How do you access the ReadOnly="True" property in code behind while the grid is being edited this way?  I've tried a few methods but it doesn't seem to be working.

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" AllowAutomaticUpdates="True">
    <MasterTableView DataKeyNames="ID" DataSourceID="SqlDataSource1" EditMode="Batch">
        <CommandItemSettings ShowAddNewRecordButton="False" ShowSaveChangesButton="True" />
        <BatchEditingSettings EditType="Row"/>
        <Columns>
            <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SalesPersonNo" FilterControlAltText="Filter SalesPersonNo column" HeaderText="SalesPersonNo" SortExpression="SalesPersonNo" UniqueName="SalesPersonNo" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ItemCode" FilterControlAltText="Filter ItemCode column" HeaderText="Item Code" SortExpression="ItemCode" UniqueName="ItemCode" ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CYF_UNITS_JAN" DataType="System.Int32" FilterControlAltText="Filter CYF_UNITS_JAN column" HeaderText="CY JAN" SortExpression="CYF_UNITS_JAN" UniqueName="CYF_UNITS_JAN" DataFormatString="{0:n2}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CYF_UNITS_FEB" DataType="System.Int32" FilterControlAltText="Filter CYF_UNITS_FEB column" HeaderText="FEB" SortExpression="CYF_UNITS_FEB" UniqueName="CYF_UNITS_FEB" DataFormatString="{0:n2}">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Viktor Tachev
Telerik team
 answered on 14 Apr 2016
1 answer
319 views

Hi!

    I use popup edit mode for Add New button in the Grid, as below

  <EditFormSettings UserControlName="../UserControl/Detail.ascx" EditFormType="WebUserControl" PopUpSettings-Height="300px" PopUpSettings-Width="350px"><EditColumn UniqueName="EditCmdFrm"></EditColumn>

   I need to know how to set the position for popup windows close[x] button, as my [x] close button not displaying correctly on the screen, see attached file.

Thanks in advance!

SH

Viktor Tachev
Telerik team
 answered on 14 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?