Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
343 views
I am using Telerik RadGrid and I have a data source where one of my columns look like hh:mm:ss. When I load the datasource of the RadGrid from the database I order the results (on SQL level) based on a DateTime column (which contains year, month and day too), but in the grid representation I am showing just hh:mm:ss. My custom sort on SQL level is working well, in a given page I get exactly those elements which should be there. However, when I sort a column which is essentially a DateTime but is represented as hh:mm:ss, default telerik sort also occurs which sorts the rows in the given page. This is incorrect, because '09-12-2012 20:20:20' < '09-13-2012 10:10:10', but '20:20:20' > '10:10:10'. How can I prevent default telerik sort for my RadGrid? I want everything else to work in the same way, I just want to tell Telerik "do not sort my column, I've already handled the sort event, thanks". How can I achieve this?
Lajos
Top achievements
Rank 1
 answered on 15 Sep 2012
2 answers
140 views
Hello,
I'm trying to use radgrid client edit ("inplace" edit mode) on a parent table which has a detail table. (There is no need to update the cells of the detail table)
I change the parent table's cell value and then I click to another row and expand the detail table. But the cell which I updated turns to its old value. Updated data is lost. How can I hold the updated values when I expand the other rows? Please help.
Thanks in advance
butters1982
Top achievements
Rank 1
 answered on 15 Sep 2012
1 answer
110 views
I have a radiobutton column in the level of my hierarchical grid, when I set at a higher level I want the child levels to be set from the code behind, but I cannot get precisely the syntax to iterate the mastertable/detailtable associates with the find control.  also I am not sure if I am starting form the correct location in code, my starting point is the radiobutton index changed event, also this is not load on demand detail table, the entire grid is loaded at once.  thank you in advance for your assistance.  
Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Sep 2012
2 answers
86 views
I am trying to add a circle to my subitems in the panel bar
I have tried this css code:
.RadPanelBar ul.rpGroup {
    list-style-type:circle !important;
}

This does not do anything at all. I checked with firebug in firefox and my line is at the top, i have even added the !important tag to overwrite everything else. But still no help.

I am using the metro skin. Because i am keen to keep lots of the functionality it already has. I have made some small changes that worked but this one just does not.

I have attached a screenshot from firebug showing my code at the top.

Anyone know why this is happening?
Andrew
Top achievements
Rank 1
 answered on 15 Sep 2012
2 answers
398 views
Folks,

I am using VS2010 with RadControls for ASP.NET AJAX Q2 2012 SP1. I would like to hide certain ComboBox items based on Values from an array. Below is my complete code. Any help will be appreciated.
Thanks
gc_0620
________________
<telerik:RadComboBox ID="Address_LocationRadComboBox" runat="server" SelectedValue='<%# Bind("Address_Location") %>'
    Text='<%# Bind("Address_Location") %>' Width="150px">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="Florida" Value="Florida" />
        <telerik:RadComboBoxItem runat="server" Text="New Jersey" Value="New Jersey" />
        <telerik:RadComboBoxItem runat="server" Text="New York" Value="New York" />
        <telerik:RadComboBoxItem runat="server" Text="Ohio" Value="Ohio" />
        <telerik:RadComboBoxItem runat="server" Text="Wisconsin" Value="Wisconsin" />
    </Items>
</telerik:RadComboBox>
 
.........
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
  string[] retrievedLocations = (string[])Session["LocationData"];
  Array.Sort(retrievedLocations);
 
  // Assuming Array retrievedLocations has following Values:
 
  // New Jersey
  // New York
  // Wisconsin
 
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
 
    {
        GridEditableItem item = (GridEditableItem)e.Item;
 
        // Beginning of Loop each row in array retrievedLocations until no rows in array
 
        RadComboBox combo = (RadComboBox)item.FindControl("Address_LocationRadComboBox");
 
        foreach (RadComboBoxItem ComboItem in combo.Items)
        {
            if (ComboItem.Value != row value of array retrievedLocations)
            {
               ComboItem.Visible = false;
            }
            else
            {
               ComboItem.Visible = true;
            }
 
        }
        
       // End of Loop each row in array retrievedLocations until no rows in array
 
    }
}


gc_0620
Top achievements
Rank 1
 answered on 14 Sep 2012
6 answers
1.1K+ views
I have a need to show a grid will several columns that I don't want the user to see when the grid goes into edit mode.
I am adding the source code to the grid. I need to hide the "Date Due", "Description", "User Reference", etc...
                                <telerik:RadAjaxPanel ID="apnlPayments" runat="server" LoadingPanelID="ajaxLoadingPanel">
                            <telerik:RadGrid ID="gridPayments" runat="server"  AllowAutomaticDeletes="true" AllowAutomaticUpdates="true"
                                AllowAutomaticInserts="true" AllowFilteringByColumn="false" AllowPaging="false" 
                                AllowSorting="true" AllowMultiRowSelection="true" CellSpacing="0" CellPadding="0"
                                PageSize="500" ShowGroupPanel="false" AllowCustomPaging="false" 
                                EnableLinqExpressions="false" GridLines="Both" HeaderStyle-Wrap="false"
                                AutoGenerateColumns="false" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"
                                OnItemDataBound="grid_ItemDataBound" OnPageIndexChanged="grid_PageIndexChanged"
                                OnPageSizeChanged="grid_PageSizeChanged" OnNeedDataSource="grid_NeedDataSource"
                                OnInsertCommand="gridPayments_InsertCommmand" OnUpdateCommand="gridPayments_UpdateCommand"
                                OnDeleteCommand="gridPayments_DeleteCommand" OnPreRender="gridPayments_PreRender">
                                <ClientSettings allowautoscrollondragdrop="false" allowexpandcollapse="false" allowgroupexpandcollapse="false">
                                    <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
                                    <Scrolling AllowScroll="false" UseStaticHeaders="true"  FrozenColumnsCount="4" />
                                    <ClientEvents OnGridCreated="grid_GridCreated" />
                                    <Resizing AllowResizeToFit="true" EnableRealTimeResize="true" />
                                </ClientSettings>
                                <MasterTableView EditMode="EditForms" CommandItemDisplay="Top" AutoGenerateColumns="false"
                                    DataKeyNames="LoanPaymentID" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                                    <ItemStyle CssClass="Row0" />
                                    <AlternatingItemStyle CssClass="Row1" />
                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px" /></RowIndicatorColumn>
                                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="20px" /></ExpandCollapseColumn>
                                    <Columns>
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" Visible="true">
                                            <ItemStyle HorizontalAlign="Center" Wrap="false" VerticalAlign="Middle" /></telerik:GridEditCommandColumn>
                                            <telerik:GridButtonColumn ConfirmText="Delete this Payment?" ConfirmDialogType="RadWindow"
                                            ConfirmTitle="Delete" ButtonType="ImageButton" ImageUrl="~/Images/icon_delete.png"
                                            CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </telerik:GridButtonColumn>
                                        <telerik:GridBoundColumn DataField="LoanPaymentPS_ACCT_NO" MaxLength="50" FilterControlAltText="Filter LoanPaymentPS_ACCT_NO column"
                                            HeaderStyle-Wrap="false" HeaderText="PS ACCT NO" SortExpression="LoanPaymentPS_ACCT_NO"
                                            UniqueName="PS_ACCT_NO" ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridDateTimeColumn DataField="LoanPaymentDateDue" DataFormatString="{0:MM/dd/yyyy}"
                                            FilterControlAltText="Filter LoanPaymentDateDue column" HeaderStyle-Wrap="false"
                                            HeaderText="DATE DUE" SortExpression="LoanPaymentDateDue" UniqueName="LoanPaymentDateDue" ReadOnly="true">
                                        </telerik:GridDateTimeColumn>
                                        <telerik:GridDateTimeColumn DataField="LoanPaymentDatePaid" DataFormatString="{0:MM/dd/yyyy}"
                                            FilterControlAltText="Filter LoanPaymentDatePaid column" HeaderStyle-Wrap="false"
                                            HeaderText="DATE PAID" SortExpression="LoanPaymentDatePaid" UniqueName="LoanPaymentDatePaid" DataType="System.DateTime">
                                        </telerik:GridDateTimeColumn>
                                        <telerik:GridNumericColumn DataField="LoanPaymentAmount" NumericType="Currency" FilterControlAltText="Filter LoanPaymentAmount column"
                                            HeaderStyle-Wrap="false" HeaderText="AMOUNT" SortExpression="LoanPaymentAmount"
                                            UniqueName="LoanPaymentAmount">
                                        </telerik:GridNumericColumn>
                                        <telerik:GridBoundColumn DataField="LoanPaymentDescription" MaxLength="50" FilterControlAltText="Filter LoanPaymentDescription column"
                                            HeaderStyle-Wrap="false" HeaderText="DESCRIPTION" SortExpression="LoanPaymentDescription"
                                            UniqueName="LoanPaymentDescription">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="LoanPaymentUserReference" MaxLength="50" FilterControlAltText="Filter LoanPaymentUserReference column"
                                            HeaderStyle-Wrap="false" HeaderText="USER REFERENCE" SortExpression="LoanPaymentUserReference"
                                            UniqueName="LoanPaymentUserReference">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="LoanPaymentMethodNo" MaxLength="50" FilterControlAltText="Filter LoanPaymentMethodNo column"
                                            HeaderStyle-Wrap="false" HeaderText="METHOD NO" SortExpression="LoanPaymentMethodNo"
                                            UniqueName="LoanPaymentMethodNo">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="LoanPaymentMethodReference" MaxLength="50" FilterControlAltText="Filter LoanPaymentMethodReference column"
                                            HeaderStyle-Wrap="false" HeaderText="METHOD REFERENCE" SortExpression="LoanPaymentMethodReference"
                                            UniqueName="LoanPaymentMethodReference">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="LoanPaymentType" MaxLength="50" FilterControlAltText="Filter LoanPaymentType column"
                                            HeaderStyle-Wrap="false" HeaderText="TYPE" SortExpression="LoanPaymentType" UniqueName="LoanPaymentType">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                                <FilterMenu EnableImageSprites="false" />
                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" />
                            </telerik:RadGrid>                   
                        </telerik:RadAjaxPanel>
Pam
Top achievements
Rank 2
 answered on 14 Sep 2012
1 answer
134 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
119 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
200 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
129 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?