Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
243 views
Hi,

I have a strange issue.

I have a form that has multiple RadGrids. On a few of these Grids I have a Delete Command which would delete that particular row.

When the delete command is called, the appropriate event is fired and the code is executed correctly. The right row gets deleted from the database. However, when the control refreshes, it results in an empty grid. If I refresh the entire page, the grid will show the correct number of rows.

I've used the delete command on many other forms without this issue. and I'm stuck on what could be the cause.

Anyone else had the issue when the Delete Command is fired that the grid displays no rows, even though the database rows are there?

Thanks
JM
Paul
Top achievements
Rank 1
 answered on 14 Dec 2011
1 answer
31 views
Hello,

There is not any record available in this link.

for more info check attached image.

Thanks,
Jayesh Goyani
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Dec 2011
1 answer
42 views
I'm having a weird problem with some of the RadGrids I'm using. Certain columns appear all in white and without any controls in them when in edit mode. This happens in IE, Chrome, and Firefox (except the column is yellow in Firefox), and I don't understand why.

You can see 2 pics of the grid attached below. One is in read only mode, and the other is in edit mode. Do notice that I am using inplace editing and making all of the rows editable.

Here's the aspx code (I renamed some column and control names).

<telerik:RadGrid ID="radgrid1" AutoGenerateColumns="False" runat="server"
    GridLines="None" Skin="Office2007" CellSpacing="0" DataSourceID="radgrid1DataSource"
    OnItemInserted="radgrid1_ItemInserted" AllowAutomaticInserts="true"
    OnItemDataBound="radgrid1_ItemDataBound" OnItemCommand="radgrid1_ItemCommand"
    AllowAutomaticDeletes="true" ValidationSettings-EnableValidation="false">
    <MasterTableView DataKeyNames="KeyID" EditMode="InPlace" AllowAutomaticInserts="true"
        AllowAutomaticDeletes="true">
        <Columns>
            <telerik:GridBoundColumn DataField="KeyID" Visible="false" UniqueName="KeyID"
                HeaderText="<%$ Resources:GlobalResources, KeyID %>" />
            <telerik:GridBoundColumn DataField="ProjectID" Visible="false" UniqueName="ProjectID"
                HeaderText="<%$ Resources:GlobalResources, ProjectID %>" />
            <telerik:GridBoundColumn DataField="Name" UniqueName="Name"
                HeaderText="<%$ Resources:GlobalResources, Name%>" />
            <telerik:GridNumericColumn DataField="InitialAmount" NumericType="Number"
                DataFormatString="{0:N}" DecimalDigits="2" UniqueName="InitialAmount"
                HeaderText="<%$ Resources:GlobalResources, InitialAmount%>" />
            <telerik:GridTemplateColumn UniqueName="CurrencyCode" ItemStyle-Width="260px"
                HeaderText="<%$ Resources:GlobalResources, CurrencyCode %>">
                <ItemTemplate>
                    <%# DataBinder.Eval(Container.DataItem, "CurrencyCode") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <cc:CurrencyDropDownList ID="ddlCurrency" runat="server" IsAlertsVisible="false"
                        IsLockVisible="false" IsHistoryVisible="false" IsFieldLabelVisible="false" IsReadOnly="false"
                        IncludeNullValue="false" MyDropDownList-SelectedValue='<%# Bind("CurrencyCode") %>' />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
             
            <telerik:GridCheckBoxColumn DataField="ToDelete" UniqueName="ToDelete" HeaderText="Delete" />
            <telerik:GridEditCommandColumn ButtonType="PushButton" InsertText="Confirm" EditText="Edit"
                CancelText="Cancel" UniqueName="EditCommandColumn" />
        </Columns>
        <NoRecordsTemplate>
            No Records Found.
        </NoRecordsTemplate>
        <CommandItemTemplate>
            <table cellpadding="5" style="width: 100%">
                <tr>
                    <td align="left">
                        <asp:LinkButton ID="btnAddNewRecord" runat="server" CommandName="InitInsert">
                            <img style="border:0px" alt="" src="../Images/add.png" />Add New Record
                        </asp:LinkButton>
                    </td>
                    <td align="right">
                        <asp:LinkButton ID="btnDeleteSelected" runat="server" CommandName="DeleteSelected"
                            OnClientClick="javascript:return confirm('Delete all selected records?')">
                            <img src="../Images/delete.png" alt="" style="border:0px" />Delete Selected
                        </asp:LinkButton>
                    </td>
                </tr>
            </table>
        </CommandItemTemplate>
    </MasterTableView>
</telerik:RadGrid>


Here's some of the only relevant C# code (i.e. relevant to the ToDelete column and the grid itself):

protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsInEditMode)
            {
                for (int i = 0; i < this.radgrid1.PageSize; i++)
                {
                    this.radgrid1.EditIndexes.Add(i);
                }
 
                this.radgrid1.Columns.FindByUniqueName("ToDelete").Visible = true;
                this.radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Bottom;
            }
            else
            {
                this.radgrid1.Columns.FindByUniqueName("ToDelete").Visible = false;
                this.radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
            }
        }
 
protected void radgrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e != null)
            {
                if (e.Item is GridDataItem && !e.Item.IsInEditMode)
                {
                    GridDataItem item = e.Item as GridDataItem;
                    Button editButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0];
                    editButton.Visible = false;
                }
                else if (e.Item is GridDataInsertItem && e.Item.IsInEditMode)
                {
                    GridDataInsertItem item = e.Item as GridDataInsertItem;
                    Button insertButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0];
                    Button cancelButton = (Button)item.Controls[item.Controls.Count - 1].Controls[2];
                    insertButton.Visible = true;
                    cancelButton.Visible = true;
                }
                else if (e.Item is GridDataItem && e.Item.IsInEditMode)
                {
                    GridEditableItem item = e.Item as GridEditableItem;
                    Button editButton = (Button)item.Controls[item.Controls.Count - 1].Controls[0];
                    Button cancelButton = (Button)item.Controls[item.Controls.Count - 1].Controls[2];
                    editButton.Visible = false;
                    cancelButton.Visible = false;
                }
            }
        }


Basically, when I'm in readonly mode, I hide the ToDelete column, the Edit/Update/Cancel buttons and I do not display the commanditem controls.

In Edit mode, I display the ToDelete column and hide the Edit/Update/Cancel buttons. On the other hand, I display the command item controls.

Any help?

Thanks.
Pavlina
Telerik team
 answered on 14 Dec 2011
2 answers
185 views
I'm adding a dropdown filter control as a usercontrol. Basically like the demo at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx but take the RadComboBox and script and put them into a usercontrol. See code block

<telerik:GridHyperLinkColumn .... UniqueName="CustomerNumber" Groupable="False">
   <FilterTemplate>
      <vtx:GridFilter ID="CustNumFilter" Field="CustomerNumber" runat="server"/>
   </FilterTemplate>
</tlk:GridHyperLinkColumn>

I need to get access to the usercontrol programmatically to add the data to it but I cannot figure out how and where to do this.

Thanks

Colin Blakey

ColinBlakey
Top achievements
Rank 2
 answered on 14 Dec 2011
1 answer
98 views
The Load event gets fired as is's supposed to be. Why isn't the AppointmentDataBound event fired?
Ivana
Telerik team
 answered on 14 Dec 2011
21 answers
257 views
Hi,
I am using Telerik Q2 2009 RadScheduler together with RadTooltip as described in LiveDemos.Here is  the code of my control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="monthschedule.ascx.cs" Inherits="com.epam.epm3ie.uc.artist.MonthSchedule" %> 
<%@ Reference Control="tooltip.ascx" %> 
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional" > 
    <ContentTemplate> 
        <telerik:RadScheduler runat="server" ID="radScheduler" Width="750px" DayStartTime="09:00:00" DayEndTime="22:00:00"   
            DataKeyField="UniqueID" DataSubjectField="eventName" DataStartField="startTime" DataEndField="endTime" 
            MonthView-VisibleAppointmentsPerDay="10" Culture="<%# UserCulture %>" FirstDayOfWeek="<%# UserFirstDayOfWeek %>" 
            SelectedView="MonthView" AllowDelete="false" MonthView-AdaptiveRowHeight="true" MonthView-HeaderDateFormat="MMMM yyyy" 
            OverflowBehavior="Expand" OnAppointmentDataBound="radScheduler_AppointmentDataBound" 
            StartEditingInAdvancedForm="false" OnClientAppointmentInserting="OnClientAppointmentInserting" 
            OnClientAppointmentEditing="OnClientAppointmentEditing" OnNavigationComplete="radScheduler_NavigationComplete"   
            OnAppointmentCreated="radScheduler_AppointmentCreated" OnDataBound="radScheduler_DataBound">  
            <Localization AdvancedAllDayEvent="All day"></Localization> 
            <AdvancedForm Modal="true" /> 
            <TimelineView UserSelectable="false" /> 
        </telerik:RadScheduler> 
        <telerik:RadToolTipManager runat="server" ID="radToolTipManager" Width="320" Height="170" 
        Animation="None" HideEvent="LeaveToolTip" Text="Loading..." 
        OnAjaxUpdate="radToolTipManager_AjaxUpdate" OnClientBeforeShow="clientBeforeShow" /> 
    </ContentTemplate> 
</asp:UpdatePanel> 

And the problrem is that when you try to navigate the scheduler in month view (change day to the another month or navigate month to next or previous using buttons < >) the content of the scheduler doesn't redraw. It looks like the month has changed, by there are no any appointment and cells of scheduler are absolutely empty even without date in the corner. But when you just move mouse pointer over the cells of scheduler, the wright appointmets draw in the cells. It is strange, but this situation take place only in Month view - in week view or day view everething is ok.  Other brousers like FireFox, Opera and even IE6 alwas redraw scheduler content.

Another problem relate to the appointment style in Month View of scheduler - in the IE6 and IE8 the appointment name doesn't cut if it is longer than the cell, this looks not good - scrollbars appear in IE, and borders of the vertical columns of days are shifted relative to the week day names in the top of scheduler. 
Helen
Telerik team
 answered on 14 Dec 2011
1 answer
60 views

Hi
I'd like some guidance on the best approach to solve a problem with a rad dropdown field in a rad grid.

I have an aspx page in which there is a rad tabstrip with two radtabs.

The contents of the selected rad tab is a radgrid that is programmatically generated ON THE SERVER SIDE, in the code behind.

Each row in the grid can be edited.  The editing feature is implemented by a button in the grids command panel labeled Edit.
When pressed, an ItemDataBound event is fired on the server side, it then seeks the column to be converted to a dropdown, in the currently selected row and modifies it into a  radcombobox.  I'm new to telerik so I'm not certain if the radcombox has a text mode for display and a dropdown for edit.  It does not appear that the specific cell has a unique name, it is identified by selected row and column name only.

My issue is that often, the width of the column is less than the width of the GridDropDown control resulting in the drown down button on the right of the control to not appear unless the width of the column is increased.  The documentation suggests that the way to correct this is to issue a repaint() of the client side control. 

I have several questions:
Since this conversion of the display from text to dropdown is done on the server side, how do obtain the client side control to issue a repaint()?
Is there jquery selector that will just find all the raddropdown controls on the page and refresh them all (sort of like selecting all div tags)?  What is the syntax? and how do I fire it after the server side has made the change to edit mode?

Thanks.  I really appreciate all suggestions.

Andrey
Telerik team
 answered on 14 Dec 2011
3 answers
65 views
The new Group Header Templates functionality in Q3 2011 appears to have broken some of the functionality which worked before. I define my groupinsettings server-side as such:
Dim fId As New GridGroupByField
 fId.FieldName = "ID"
 fId.Aggregate = GridAggregateFunction.Count
 fId.FormatString = "({0})"
 fId.HeaderValueSeparator = " "
 fId.HeaderText = " "
 
Dim expr As New GridGroupByExpression
Dim fState As New GridGroupByField
fState.FieldAlias = "State"
fState.FieldName = "GroupState"
fState.FormatString = "{0}"
 
expr.SelectFields.Add(fState)
expr.SelectFields.Add(fId)
 
Dim fGroupState As New GridGroupByField
fGroupState.FieldName = "GroupState"
expr.GroupByFields.Add(fGroupState)
 
MyGrid.MasterTableView.GroupByExpressions.Add(expr)


In q2 it looked like the attached q2.jpg. In Q3 it look slike the attached q3.jpg. There is no difference in code.
Martin
Telerik team
 answered on 14 Dec 2011
2 answers
58 views
Hello Team;

I would like to suggest a couple of cosmetic improvement with Metro theme and ASP GridView.
  • The refresh button icon on the command area is unclear and distorted
  • On the same area the "+" icon for the Add a new record is hard to see. Should be more dark or White on the blue background.
  • In the Popup windows, there is no window header color and the border color is too weak. That window needs to stand out better.
  • Generally, there in Metro, there are lots of "Light Gray" color is used for lines in particular in Grid. Would it be possible to make it a bit darker? Users say, the line color is washed out.

I think the other upcoming Metro themes should have same improvements.

Thank you in advance!

Ben Hayat
Top achievements
Rank 2
 answered on 14 Dec 2011
1 answer
34 views
Hi sir,
iam using scheduler with customized advance form as shown in demo...appointment color picker is not getting visible in IE...where as it is visible  in chrome,firefox...please go through the attached image...please give me solution as soon as possible..




Thanks
Rajesh 
Ivana
Telerik team
 answered on 14 Dec 2011
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?