Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
297 views
Hello, 

I have a column 

 <telerik:GridButtonColumn CommandName="SELECT" Text="SELECT" 
                        UniqueName="Select" >
 </telerik:GridButtonColumn>

in a radgrid, and I have the radgrid property 

onitemcommand="ItemCommand"

But when the button is clicked the event does not fire. Any ideas? I am on a deadline fast coming and this has stopped me in my tracks

All I could find in my searches is that I need to enable viewstate, but that has had no effect. 
Michael
Top achievements
Rank 1
 answered on 06 Jan 2012
3 answers
232 views
I'm dealing with quite large datasets here, and my application seems to throw an IO timeout exception if i set ignorepaging to true and there's too much data.

So what i've done is created a hiddenfield for my total record count and i want to limit the number of records exported to 500, in the hope this will avert said exception, see below:,

If hd_rowcount.Value > 499 Then   
   Me.rg_properties.PageSize = 500
   Me.rg_properties.ExportSettings.IgnorePaging = False
End If

However this doesn't work. I'm assuming because the pagesize has already been set to 20, thus only 20 records are being exported.

Is there a way i can achieve the above results or are there any other suggestions you'd recommend?
Alan T
Top achievements
Rank 1
 answered on 06 Jan 2012
4 answers
292 views
I have, I believe, followed the examples correctly, but every time I try to Export to PDF  the entire table opens in the current window.

rgUsers.ExportSettings.ExportOnlyData = true;
rgUsers.ExportSettings.IgnorePaging = true;
rgUsers.ExportSettings.OpenInNewWindow = true;
rgUsers.MasterTableView.ExportToPdf();

I expect to get all the data and I do, If I change the "IgnorePaging" to false I just get the first page, as I would expect. But changing the value of OpenInNewWindow has no observable effect.

I am obviously missing something very simple, but I just can 't see it. Any ideas?
Martin
Top achievements
Rank 1
 answered on 06 Jan 2012
2 answers
98 views
Am having truoble with my autogenerated edit form after posting back the if an EntityDataSourceValidationException is thrown.  I am overriding the Entity DataSource Inserting Event and using automatic inserts on the grid. 

The first time the exception is thrown the drop downs in my edit form retain their values and I am able to insert the values after correcting the errors on the form.

However, if I try to insert again without correcting the validation errors, after postback the values in the drop down lists are lost and the edit form is then unusable.

Hoping to hear if this the right way to do this, or if I need to just allow the grid to auto insert withough overriding the Entity Data Source Inserting Event.

I am providing the grid code, entity data source and the code for the inserting event.

<ajci:JMGrid ID="ItemsGrid" runat="server" DataSourceID="edsAssetManager" AutoGenerateColumns="false" Skin="Windows7"
     AllowAutomaticInserts="true" AllowAutomaticDeletes="true" AllowAutomaticUpdates="false" DataKeyNames="id" OnUpdateCommand="GridOnUpdate">
    <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true"
        FileName="AssetList">
        <Excel Format="Html" FileExtension="xls" />
    </ExportSettings>
    <MasterTableView EditMode="PopUp" AllowFilteringByColumn="true" CommandItemDisplay="Top"
        CommandItemSettings-AddNewRecordText="Add Items" DataKeyNames="id" TableLayout="Fixed">
        <EditFormSettings CaptionFormatString="Add/Edit Item" PopUpSettings-Modal="true" EditFormType="AutoGenerated">
    </EditFormSettings>
 
    <CommandItemTemplate>
        <asp:LinkButton runat="server" ID="lnkAdd" Text="Add Item" CssClass="iconAdd" CommandName="InitInsert" ></asp:LinkButton>
        <asp:LinkButton ID="btnManualRefresh" CssClass="iconRefresh" runat="server" Text="Refresh Data" OnCommand="GridRefresh" />
        <asp:LinkButton ID="ExportToExcelButton2" runat="server" OnClick="ExportData" CommandArgument="Excel" Text="Export To Excel" CssClass="buttonExcel" />
    </CommandItemTemplate>
    <Columns>
        <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="100px" HeaderStyle-Width="100px" ReadOnly="true">
            <ItemTemplate>
                <div>
                    <asp:LinkButton ID="btnEdit" CommandName="Edit" runat="server"  CssClass="iconEdit" Text=" "></asp:LinkButton>
                    <asp:LinkButton ID="lbDeleteRecord" runat="server" CssClass="iconDelete" Text=" " CommandName="Delete" CommandArgument='<%# Eval("id") %>' OnClientClick="javascript:return confirm('Removing this item will also clear its related history.  Continue?')"></asp:LinkButton>
                    <a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"id") %>'); return false;">
                        <img src="../Assets/images/icons/icon-magnifying-glass.png" />
                    </a>
                     
                    <asp:Image ID="imgNote" runat="server" ImageUrl="../Assets/images/icons/icon-notes.png" />
                    <telerik:RadToolTip ID="tooltpNotes" runat="server" TargetControlID="imgNote" RelativeTo="Element"
                        Position="BottomCenter" RenderInPageRoot="true" ManualClose="true">
                        <p></p>
                        <div>
                            <asp:Label id="ttpAssetNote" runat="server" Text='<%# Eval("notes")%>'></asp:Label>
                        </div>
                    </telerik:RadToolTip>
 
                    <asp:Image ID="imgComment" runat="server" ImageUrl="../Assets/images/icons/icon-comment.png" />
                    <telerik:RadToolTip ID="tooltpComment" runat="server" TargetControlID="imgComment" RelativeTo="Element"
                        Position="BottomCenter" RenderInPageRoot="true" ManualClose="true">
                        <p></p>
                        <div>
                            <asp:Label id="ttpAssetComment" runat="server" Text='<%# Eval("comment")%>'></asp:Label>
                        </div>
                    </telerik:RadToolTip>
                    <asp:Image ID="imgQRTag" runat="server" CssClass="iconQR" ImageUrl='<%# AssetManager.Helper.QRImage.GetQRIMageURL(Eval("tag.assetTag").ToString()) %>' />
                    <telerik:RadToolTip ID="tltpQRStatus" runat="server" TargetControlID="imgQRTag"
                    RelativeTo="Element" Position="BottomCenter" RenderInPageRoot="true" EnableShadow="true"
                    ManualClose="true">
                        <div >
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# AssetManager.Helper.QRImage.GetQRIMageURL(Eval("tag.assetTag").ToString()) %>' Target="_blank" Text="Asset QR Code"/>
                        </div>
                        <div id="RenderedQR">
                            <asp:Image ID="qrImage" runat="server" ImageUrl='<%# AssetManager.Helper.QRImage.GetQRIMageURL(Eval("tag.assetTag").ToString()) %>'
                                Title='<%# Eval("tag.assetTag") + ".png" %>' ClientIDMode="Static"/>
                        </div>
                        <div>
                            <asp:Label ID="lblQRAssetID" runat="server" Text='<%# Eval("tag.assetTag") %>'></asp:Label>
                        </div>
                    </telerik:RadToolTip>                    </div>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridDropDownColumn  UniqueName="DDLassetTag" DataSourceID="edsAssetTag" SortExpression="assetTag" ListTextField="assetTag" ListValueField="id" HeaderText="AssetTag" DataField="tagID" EmptyListItemText="Choose an Asset Tag" EmptyListItemValue="" EnableEmptyListItem="true" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="95px" HeaderStyle-Width="135px" ItemStyle-Width="100px"/>
       <telerik:GridBoundColumn DataField="itemName" AllowFiltering="true" AllowSorting="true" HeaderText="Item Name" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="120px" HeaderStyle-Width="160px"></telerik:GridBoundColumn>
        <telerik:GridDropDownColumn UniqueName="DDLManufacturer" DataSourceID="edsManufacturer" SortExpression="mfgName" ListTextField="mfgName" ListValueField="id" HeaderText="Manufacturer" DataField="mfgID" EmptyListItemText="Choose a Manufacturer" EmptyListItemValue="" EnableEmptyListItem="true" FilterControlWidth="65px" HeaderStyle-Width="105px"/>
        <telerik:GridBoundColumn DataField="modelNumber" AllowFiltering="true" AllowSorting="true" HeaderText="Model Number" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="95px" HeaderStyle-Width="135px" ItemStyle-Width="100px"></telerik:GridBoundColumn>
        <telerik:GridTemplateColumn DataField="notes" UniqueName="Notes" HeaderText="Notes"  Display="false" AllowFiltering = "false" FilterControlWidth="120px" HeaderStyle-Width="150px">
        <ItemTemplate>
            <%# Eval("notes") %>
        </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtNotes" Text='<%# Bind( "notes") %>' Columns="30" Rows="5"
                    TextMode="MultiLine" runat="server"></asp:TextBox>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="comment" UniqueName="Comments" HeaderText="Comments" Visible="false" AllowFiltering = "false" FilterControlWidth="65px" HeaderStyle-Width="100px">
        <ItemTemplate>
            <%# Eval("comment") %>
        </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtComments" Text='<%# Bind( "comment") %>' Columns="30" Rows="5"
                    TextMode="MultiLine" runat="server"></asp:TextBox>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
 
        <telerik:GridBoundColumn DataField="serialNumber" AllowFiltering="true" AllowSorting="true" HeaderText="Serial Number" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="95px" HeaderStyle-Width="135px" ItemStyle-Width="100px"></telerik:GridBoundColumn>
        <telerik:GridDropDownColumn UniqueName="DDLWho" DataSourceID="edsWho" SortExpression="name" ListTextField="name" ListValueField="id" HeaderText="User / Location" DataField="whoID" EnableEmptyListItem="true" EmptyListItemText="" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="95px" HeaderStyle-Width="135px" ItemStyle-Width="100px"/>
        <telerik:GridDropDownColumn UniqueName="DDLStatus" DataSourceID="edsStatus" SortExpression="name" ListTextField="name" ListValueField="id" HeaderText="Status" DataField="statusID" EmptyListItemText="Choose a Status" EmptyListItemValue="" EnableEmptyListItem="true" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="95px" HeaderStyle-Width="135px" ItemStyle-Width="100px"/>
        <telerik:GridCheckBoxColumn DataField="IPv6Compliant" AllowFiltering="false" AllowSorting="true" HeaderText="v6" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"></telerik:GridCheckBoxColumn>
    </Columns>
 
</MasterTableView>
</ajci:JMGrid>
<asp:EntityDataSource runat="server" ID="edsAssetManager" EntitySetName="assets" ConnectionString="name=AssetTagManager"
    DefaultContainerName="AssetTagManager" EnableInsert="true" EnableDelete="true" Include="tag" OnInserting="MyEdsInserting" OnUpdating="MyEdsInserting"
    EnableUpdate="true" />
protected void MyEdsInserting(object sender, EntityDataSourceChangingEventArgs e)
{
     
    List<string> _error = new List<string>();
    AssetManager.FormException FormException = new AssetManager.FormException();
    AssetManagerDevModel.asset x = ((AssetManagerDevModel.asset)e.Entity);
    if (e.Exception is EntityDataSourceValidationException && e.Exception is System.Web.DynamicData.IDynamicValidatorException)
    {
        foreach (KeyValuePair<string, Exception> innerException in ((System.Web.DynamicData.IDynamicValidatorException)e.Exception).InnerExceptions)
        {
            _error.Add(innerException.Key + " is Blank");
        }
    }
    else
    {
        if (x.itemName == null)
            _error.Add("Name cannot be blank");
        if (x.tagID == null || x.tagID ==0)
            _error.Add("You must select a tag from the list");
        if (x.statusID  == 0)
            _error.Add("You must select an available status");
    }
 
    if (_error.Count > 0)
    {
        e.Cancel = true;
        e.ExceptionHandled = true;
        throw new Helper.DataInvalidException(_error);
    }
 
    else
    {
        x.modifyBy = HttpContext.Current.User.Identity.Name.Split('\\')[1];
        x.modifyDate = DateTime.Now;
    }
}

Thanks!

Jeremy
Top achievements
Rank 1
 answered on 06 Jan 2012
3 answers
184 views
We have a RadListview which is binding to a DataSource control and have item, edit and insert templates.
The datasource control takes care of selecting the object when the page loads and does the data bind.  The datasource control (actually a CslaDataSource control) binds to our business layer objects which are enumerable, and we just show one "record" in the listview.
Really we are making use of the templating to show display, edit and insert modes for our record/object.

We also tend to have our own user controls also in the templates and pass the business object down to them so they can bind to their respective controls.

All works well.

Except we have one slight issue.  When inserting a new record and attempting a save, the datasource control xxx_Update method gets fired and if the business object throws an error (typically as some business rule is broken and it cannot be saved yet), the RowsAffected is zero and we set a PageHasErrors flag.

The page posts back and in our Page_PreRender event we try and switch the listview back into Insert mode as we want to keep it there in that template as the save failed.  Unfortunately this doesn't quite work as we end up with the display item template shown first and then the insert template below.

It almost looks like it has created 2 records in the listview.

Any ideas?
Andrey
Telerik team
 answered on 06 Jan 2012
1 answer
152 views
Hi,

I want to get record into radgrid when radcombobox client selected index changed. i want full code for ASMX page. please let me know how to bind the grid whlie radcomobox selected index changed using selected value.

Thanks,
Dhamu.
Richard
Top achievements
Rank 1
 answered on 06 Jan 2012
1 answer
136 views
I made the following Javascript function which successfully makes the DatePicker  readonly (including no select from the calendar) without the grey fuzzy appearance. (I think it might be possible to do this with CSS, not sure, but we are in IE, where that doesn't work.) I don't know if this is the best approach, but it works fine. I think it's a common need, and I couldn't find it documented anywhere, so I'm posting it here in case others can use it. Function also supports making editable again.

function SetDatePickerReadOnly(picker, readOnly) {
    picker.set_enabled(!readOnly);  // disable the overall control if readOnly is true (or the converse)
    var input = picker.get_dateInput();  //retrieves the inner DateInput portion of the DatePicker
    input.enable(); // enable the input box only, leaving the calendar disabled (or the converse)
    input._textBoxElement.readOnly = readOnly;  //the inner reference to the input object; changes appearance to "ReadOnly" style and not editable
    // (or the converse)
}

Usage:
var dobPicker = $find("<%= DateOfBirthDatePicker.ClientID %>");
SetDatePickerReadOnly(dobPicker, true);


Maria Ilieva
Telerik team
 answered on 06 Jan 2012
1 answer
160 views
I have a visual studio 2010 web application project and referencing the 1st Qtr 2010 telerik dll.  I am using 4.0 framework.  I precompile and then deploy to local IIS (7.0).  Then, when I navigate to the site, it takes a long time on the first page visit (over a minute).  I suspect this is related to the telerik controls.  Any suggestions to check to resolve this?

thanks,
Jon

Update: Do I need to reference Telerik.Web.UI from the GAC?  I tried installing it in the GAC, but I still can't find it in the Add Reference... window.
Richard
Top achievements
Rank 1
 answered on 06 Jan 2012
1 answer
172 views
Hello,

I am trying to add a custom button to a RadEditor in Sitecore 6.4.  I have successfully added the button and am now defining the command.  Here is what I have so far (from a previous project):

RadEditorCommandList["InsertBrightcoveVideo"] = function(commandName, editor, tool) {
    var args = editor.GetDialogParameters(commandName);
 
    var html = editor.getSelectionHtml();
    var videoid = scItemID;
    var playerid = scItemID;
    var playlistids = scItemID;
    var wmode = "window";
    var bgcolor = "#ffffff";
    var autostart = "false";
 
    if (html) {
        videoid = getVidQStringVal(html, 'video');
        playerid = getVidQStringVal(html, 'player');
        playlistids = getVidQStringVal(html, 'playlists');
        wmode = getVidQStringVal(html, 'wmode');
        bgcolor = getVidQStringVal(html, 'bgcolor');
        autostart = getVidQStringVal(html, 'autostart');
    }
 
    scEditor = editor;
 
    editor.ShowDialog(
        "/sitecore/shell/default.aspx?xmlcontrol=RichText.InsertVideo&la=" + scLanguage + "&video=" + videoid + "&player=" + playerid + "&playlists=" + playlistids + "&selectedText=" + escape(html) + "&wmode=" + wmode + "&bgcolor=" + bgcolor + "&autostart=" + autostart,
        null, //argument
        600, //width
        500, //height
        scInsertBrightcoveVideo,
        null,
        "Insert Video");
};

I am getting a few JavaScript errors.  This first error is caused by the second line of my command.

Uncaught TypeError: Object [object Object] has no method 'GetDialogParameters'

Looking in the Client-side API Reference, I don't see the GetDialogParameters method listed, so I commented it out.  The error goes away but I receive another.

Uncaught TypeError: Object [object Object] has no method 'ShowDialog'

Strange.  Looking in the API I see that the method does in fact exist.  But if I change the method call from ShowDialog to showDialog the error goes away.  Unfortunately I receive another.

Uncaught Sys.ArgumentNullException: Sys.ArgumentNullException: Dialog Parameters for the /sitecore/shell/default.aspx?xmlcontrol=RichText.InsertVideo&la=en&video={E114FA72-EC42-43F3-8A1F-99B00541E86A}&player={E114FA72-EC42-43F3-8A1F-99B00541E86A}&playlists={E114FA72-EC42-43F3-8A1F-99B00541E86A}&selectedText=&wmode=window&bgcolor=#ffffff&autostart=false dialog do not exist
Parameter name: dialogName

Any ideas as to what could be going wrong?  I'm a little confused as to why I had to change the method call when the docs say it exists.  Is there something wrong with the editor parameter possibly?

Thanks for any help.
Richard
Top achievements
Rank 1
 answered on 06 Jan 2012
1 answer
54 views

Hi;

   I m facing problem in telerik RadSchedular  a two line title for a calender item does not fit in the color please see attached file
  i want to increase backcolor according to text size of appointments what do i do for that


please suggest
  
Princy
Top achievements
Rank 2
 answered on 06 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?