Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
177 views
Hello, 

        I have a dataset which is attached "Db Results.png" as below.
        Based on the DB results, I'm able to pull the data into screen as "Grid Results as per the DB column names.png".

        But my requirement is, If the user generate a report on Monday 09/17/2012, then he has to see the data for next five days with respective of specified dates.

       If you see the image "Expected Final Grid Results Should looks as like this.png", in that grid, the results are with respective of each date. Please could you help my how I can Acheive it?

Please find the below code:

Code.ASPX:

<

 

 

div id="dvResult" style="min-width: 64%; width: 64%; height: 98%; float: right;">

 

<fieldset>

 

<legend>Result</legend>

 

<asp:UpdatePanel ID="updReportData" runat="server">

 

<ContentTemplate>

 

<asp:Label ID="lblMetricsInfo" runat="server"></asp:Label></Br>

 

<asp:Label ID="lblMetricsBusinessInfo" runat="server"></asp:Label>

 

<div style="text-align: right">

 

<asp:LinkButton ID="lnkShowAll" Text="Show All" ToolTip="Toggle grid paging" runat="server"

 

CommandName="CurrentGrid" CommandArgument="ReportData"></asp:LinkButton>

 

<asp:ImageButton ID="imgToExcel" runat="server" ImageUrl="../images/excel_16x16.png"

 

AlternateText="Export data to Excel" ToolTip="Export grid data to Excel." Style="width: 16px;

 

 

height: 16px; cursor: pointer;" CommandName="CurrentGrid" CommandArgument="ReportData" />

 

</div>

 

<div class="gridWrapper">

 

<telerik:RadGrid ID="grdReportData" runat="server" PageSize="20" AllowSorting="True"

 

AllowPaging="True" AutoGenerateColumns="True" ShowGroupPanel="True" CssClass="grid"

 

ClientSettings-Resizing-AllowColumnResize="true" ClientSettings-Resizing-ResizeGridOnColumnResize="true"

 

ShowFooter="true">

 

<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>

 

<GroupPanel Text="">

 

</GroupPanel>

 

<MasterTableView Width="100%" TableLayout="Fixed">

 

<NoRecordsTemplate>

No records exist for the given criteria.

 

</NoRecordsTemplate>

 

</MasterTableView>

 

<ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True">

 

<Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True"></Resizing>

 

</ClientSettings>

 

</telerik:RadGrid>

 

</div>

 

</ContentTemplate>

 

<Triggers>

 

<asp:PostBackTrigger ControlID="imgToExcel" />

 

</Triggers>

 

</asp:UpdatePanel>

 

</fieldset>

 

</div>


Code.ASPX.vb File

Public sub LoadReport()
Dim Ds as dataset = nothing
Ds = Obj.GetDate()

grdReportData.DataSource = ds

grdReportData.DataBind()
End Sub

 

 

Thank You In Advance,
Satish.

Satish
Top achievements
Rank 1
 answered on 14 Sep 2012
5 answers
169 views
Hi,

   I would like to log the source file and path being copied to the destination directory. When using the OnClientCopy I do get a value for the RadFileExplorerEventArgs get_newPath() but not for the get_item. Is there a way to get this value?

Thanks!

Jed
Jed
Top achievements
Rank 1
 answered on 14 Sep 2012
4 answers
264 views
I have a radgrid that displays a date from a record in a database along with the other information in that record.  What I want to do is automatically populate that date with the current date when a user enters a new row - AND I want that date to show up on the screen before they insert it.  I know how to populate the column at the time of insert, but what I would like is when a user presses "Add new record" that a Label shows in the Edit form with the current date.

Here is my code:

 

 

 <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"   
        DataSourceID="LogBookODS" GridLines="None" AllowFilteringByColumn="True"   
        AllowPaging="True" AllowSorting="True" AllowAutomaticDeletes="True"   
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True"   
        Skin="Office2007">  
<MasterTableView DataKeyNames="LogBookID" DataSourceID="LogBookODS"   
            CommandItemDisplay="Top">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="LogBookID" DataType="System.Int32"   
            HeaderText="LogBookID" ReadOnly="True" SortExpression="LogBookID"   
            UniqueName="LogBookID" Visible="False">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="PatientID" DataType="System.Int32"   
            HeaderText="PatientID" SortExpression="PatientID" UniqueName="PatientID"   
            Visible="False" ReadOnly="True">  
        </telerik:GridBoundColumn> 
        <telerik:GridTemplateColumn DataField="LogEntryDate" DataType="System.DateTime"   
            HeaderText="Entry Date" SortExpression="LogEntryDate"   
            UniqueName="LogEntryDate">  
            <EditItemTemplate> 
            <asp:Label ID="CurrDateLbl" runat="server"></asp:Label> 
            <asp:TextBox ID="CurrDateTxtBx" runat="server" Visible="false" Text='<%# Bind("LogEntryDate") %>'></asp:TextBox> 
            </EditItemTemplate> 
            <ItemTemplate> 
                <asp:Label ID="LogEntryDateLabel" runat="server"   
                    Text='<%# Eval("LogEntryDate","{0:d}") %>'></asp:Label> 
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 
          
        <telerik:GridBoundColumn DataField="LogDescription" HeaderText="Description "   
            MaxLength="100" UniqueName="LogDescription">  
        </telerik:GridBoundColumn> 
          
        <telerik:GridTemplateColumn DataField="LogEntry" HeaderText="Log Entry"   
            SortExpression="LogEntry" UniqueName="LogEntry" AllowFiltering="False">  
            <EditItemTemplate> 
                <br /> 
                <telerik:RadEditor ID="RadEditor1" Runat="server"   
                    Content='<%# Bind("LogEntry") %>'>  
                    <Content> 
</Content> 
                </telerik:RadEditor> 
            </EditItemTemplate> 
            <ItemTemplate> 
                
                <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Edit" ImageUrl="~/images/Edit.gif" ToolTip="Click to view the log entry" /> 
               
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 
                   <telerik:GridButtonColumn ConfirmText="Delete this Entry?" ConfirmDialogType="RadWindow" 
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                        UniqueName="DeleteColumn">  
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                    </telerik:GridButtonColumn> 
 
    </Columns> 
 
<EditFormSettings> 
<EditColumn UniqueName="EditCommandColumn1" ButtonType="ImageButton"></EditColumn> 
</EditFormSettings> 
</MasterTableView> 
    </telerik:RadGrid> 
   

 

What I would like is for  CurrDateLbl to have the current date in it when the user clicks "Add New Record"

What event do I put that in?  ItemCommand fires at the right time, but I don't seem to be able to reference CurrDateLbl in that event.

Eric

 

Pam
Top achievements
Rank 2
 answered on 14 Sep 2012
2 answers
158 views
Hi,
My problem is:
I have a master page where I have RadAjaxManager and RadScriptManager.
On my aspx page I need to call with a javascript function the server with a Ajaxrequest to update a label for example.
For that, I added a RadAjaxManagerProxy and RadCodeBlock.
When I click on the button1, that working.
Form the button2 (javascript), I called the function manager_AjaxRequest but don't refresh the label.
Do you know what I missed ?
Here is a copy of my master page and detail page.

Masterpage:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="test.master.cs" Inherits="abc.pages.MasterPage.test"  ClientIDMode="AutoID" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManagerMasterPage" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager_Master" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"></telerik:RadAjaxManager>
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />
    </form>
</body>
</html>

Code begin:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
 
}

Detail page:
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server" >
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Button1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Label1"
                    LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="Button2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Label1"
                    LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<telerik:radajaxloadingpanel id="RadAjaxLoadingPanel1" runat="server" skin="Windows7" />
 
    <telerik:RadCodeBlock  ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function test() {
            var manager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
            var textBoxId = "RowSelected";
            if (manager && textBoxId) {
                manager.ajaxRequest("RowSelected");
            }
        }
    </script>
</telerik:RadCodeBlock >
 
<asp:Button ID="Button1" runat="server" Text="test 1" onclick="Button1_Click" /><br />
<asp:Button ID="Button2" runat="server" CausesValidation="false" OnClientClick="javascript:test();return false;" Text="test 2" /><br />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>

and the code behind:
protected void Page_Load(object sender, EventArgs e)
{
    RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
    manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest);
}
 
protected void Button1_Click(object sender, EventArgs e)
{
    Label1.Text = "A" + DateTime.Now.Ticks.ToString();
}
 
protected void manager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    if (e.Argument == "RowSelected")
    {
        Label1.Text = "B" + DateTime.Now.Ticks.ToString();
    }
}
daniel demesmaeker
Top achievements
Rank 1
 answered on 14 Sep 2012
5 answers
630 views
 Hi all,

I have a grid with 3 columns, a name and a date and a calculated (sql) field witch displays terms like "last week, this week, today, yesterday, next week, last year, etc..."

When i use a grouping al works fine, only the group sorting is alphabetical (of course) and thus the wrong order. I would like the grid toe group, but sort the groups logical, on the date field.

any ideas?

Thanks in advance!
Joe
Top achievements
Rank 1
 answered on 14 Sep 2012
1 answer
140 views
Hi,
I am showing daily test results over a period of time in a line chart.
The values varriy from 0% to 100%. 100% means bestand 0% means the worst.

Currently my chart line is all green. I wanted to check if I can have gradient like color which show 0% red and 100% as green and any other percentage from 0 to 100 are represented by the color which flows form red to green.

Can I achieve this?

Thanks,
Abinash
Petar Kirov
Telerik team
 answered on 14 Sep 2012
3 answers
202 views
The treelist has autogenerated columns and bound to a datatable.

I read somewhere that you need to set the width in order to get the exporting to work.  THis is the error that i'm getting:


System.SystemException: At least one of minimum, optimum, or maximum IPD must be specified on table.

Daniel
Telerik team
 answered on 14 Sep 2012
2 answers
96 views
Hi,

I'd like to have a single menu instance on a single web page.  And as I click on a menu option, A different user control is loaded into the web page.  I didn't see any samples for this.  Is this something that is possible?

Thanks,
Craig
Craig
Top achievements
Rank 1
 answered on 14 Sep 2012
2 answers
147 views
I want to autofill scheduler data when we enterd data in a Grid or textboxes means i have  4 textboxes 1.name 2.date 3.amount 4.total amount when i submit this data this data will display in scheduler for that particuler date i.e given in date text box.
siva sankar
Top achievements
Rank 1
 answered on 14 Sep 2012
0 answers
107 views

Update: I realized that the issue was caused by another control. I apologize for the post.

Hello,

I'm attempting to use the numeric textbox control provided by Telerik and I'm receiving the following error when I attempt to use the control's text value in a sql insert:

{"No mapping exists from object type System.Web.UI.WebControls.Label to a known managed provider native type."}

Here's the code that I'm using to attempt to do the insert:

'Insert/Update the Adjustment
With oCmd
    .Parameters.Clear()
    .Connection = oConn
    .CommandType = CommandType.StoredProcedure
    .CommandText = "iBill_Dashboard_Insert_Adjustments"
    With .Parameters
        .AddWithValue("@DepartmentTab", DepartmentTab)
        .AddWithValue("@ProjectType", ProjectType)
        .AddWithValue("@Month", Month)
        .AddWithValue("@Year", Year)
        .AddWithValue("@Value", tValue.Text)
        .AddWithValue("@AdjustmentID", AdjustmentID)
        .Add("@NewID", SqlDbType.Int)
    End With
    .Parameters("@NewID").Direction = ParameterDirection.Output
    .ExecuteNonQuery()
End With
AdjustmentID = oCmd.Parameters("@NewID").Value

The error occurs on the ExecuteNonQuery() method. Any help would be greatly appreciated.
Johnathan
Top achievements
Rank 1
 asked on 14 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?