Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
114 views
Hi ,

In one of our application, which uses html editor, we have a functionality where at the particular cursor position if user enters "[[" shown Brackets, it will populate all the Business specific words which are stored in our database and upon selection of particular word from the populated words list, It wll be displayed in the cursor position of the editor.

To populate these words we are calling the web service and binding it to the Div tag and displaying a Pop up as shown in the attachment.

.Now as we have decided to go with RadEditor Control, We need to achieve same functionality as users are very much habituated to this.  Please help us to achieve this. Appreciate your speed help.

Thanks & Regards
Lakiesha
Vessy
Telerik team
 answered on 10 Jun 2013
7 answers
125 views
Hi, there is a way to set the dimension of the grabber for resize appointments?
I want the line button a little bit larger, it's possible?
Boyan Dimitrov
Telerik team
 answered on 10 Jun 2013
2 answers
124 views
Hello everyone.
I am writing about a problem item "expanded and collapsed". I created a button that will "expand" or "collapsed" my items according to their status by calling a simple javascript function .
(If the item is expanded ==> item equal collapse and if the item is collapsed ==> item equal expanded).

Almost everything works perfectly. but I do not know why there is always an item at the top of my grid is always "extended". But when I debug my javascript function, I can see that my loop, foreach well on all items.

Here is my javascript code that allows me to expand or hide items based on their condition.
                function expandCollpaseAllIncident() {
                var Grid = $find("<%= RadGridToolIncident.ClientID %>");
                var MasterTable = Grid.get_masterTableView();
                for (var i = 0; i < MasterTable.get_dataItems().length; i++) {
                    var row = MasterTable.get_dataItems()[i];
                    if (row.get_expanded() == false) {
                        row.set_expanded(true);
                    }
                    else {
                        row.set_expanded(false);
                    }
                }
 
            }

And my RadGrid code Asp:
<telerik:RadGrid ShowHeader="false" ID="RadGridToolIncident" runat="server" DataSourceID="SqlDataSourceAllIncidents"
                                OnItemDataBound="RadGridToolIncident_ItemDataBound" AutoGenerateColumns="false" EnableEmbeddedSkins="false" CssClass="gridIncident_pilotageGeneral">
                                    <MasterTableView runat="server" DataSourceID="SqlDataSourceAllIncidents" DataKeyNames="toolsID"
                                    CssClass="tableBlockPilotageIncident" Width="196px" >
                                    <NoRecordsTemplate>
                                        <asp:Label runat="server" ID="lbNoRecorsTool" Text='<%$ Resources:IRM, tool_action_label_no_current %>'></asp:Label>
                                    </NoRecordsTemplate>
 
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="toolsID" Visible="false">
                                            <ItemTemplate>
                                                <asp:HiddenField runat="server" ID="lbIDTool" Value='<%# Bind("toolsID") %>'  ClientIDMode="Static"/>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn  Visible="false">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lbIDRisk" Text='<%# Bind("riskID") %>' ForeColor="#92c4f7"
                                                    Font-Bold="false" Font-Size="9px" Visible="false"></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="num" ItemStyle-CssClass="cellNumTool">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lbIDnum" Text='<%# Bind("num") %>' CssClass="numGridAction"
                                                    Font-Bold="false" Font-Size="13px" Visible="true"></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="NameIncident" ItemStyle-CssClass="cellNameTool">
                                            <ItemTemplate>
                                                <asp:LinkButton runat="server" ID="linkIncidentDetail" Text='<%# Bind("name") %>' Font-Overline="false"
                                                    CssClass="linkIncident" OnCommand="showToolDetail" Font-Size="14px" CommandName="NameClickIncident"
                                                    CommandArgument='<%# Bind("toolsID") %>' ></asp:LinkButton>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
Mehdi
Top achievements
Rank 1
 answered on 10 Jun 2013
1 answer
29 views
Hello,

If I choose the following for RadfileExplorer:

 EnableFilterTextBox="true" EnableFilteringOnEnterPressed="true"

When I go straight to the text box and enter a term, the "Back" button gets focus and nothing else seems to happen, but only in Firefox. IE10 works as you would expect.

If it helps here is some background. The company I work for is using the Fileexplorer as part of an editting tool. The Fileexplorer allows our users access to files that they have uploaded to the companies CMS system.

I have created a Filesystemprovider that gives access to files depending on the user and where they are accessing the editting tool.

I have extended this provider to have information about the default "alternative text" for images and store this in the FileItem.Path variable as a csv variable. The path looks like this:

Uploads/2350|0|0|ALTDESC|1|15&#46;01&#46;2013 16:49:47|0

I've bolded the information I want to using in the filter.

The whole thing breaks down like this: virtual path / fileid | height | width | alt description | boolval| upload date | boolval

So, in order to filter with this extra field I have to catch the filter command and then do a postback of my own, because the FilterText value is inaccessable in the code behind I have to put this in a hidden field, this I do like so:

function explorerFilterHandler(explorer, args)
{
        args.set_cancel(true);
	hField = $get("<%= explorersFilterValue.ClientID%>");
	hField.value = args.get_text();
	__doPostBack(hField.name, "");
}

As per another forum post.

Because the filter text is deleted on postback I have to refill the text box and then set the cursor to the end of the text once the OnClientLoad of the FileExplorer is fired (Onclientload = "setFilter"):


         function setFilter(){   
            var hField  = $get("<%= explorersFilterValue.ClientID%>");
            if(hField.value != ''){
                var filter = $('input[id$="FilterTextBox"]');
                filter.val(hField.value);
                filter.focus()
                setSelectionRange(filter[0], hField.value.length, hField.value.length);
            }
        }
 
        function setSelectionRange(input, selectionStart, selectionEnd) {
            if (input.setSelectionRange) {
                input.focus();
                input.setSelectionRange(selectionStart, selectionEnd);
            }
            else if (input.createTextRange) {
                var range = input.createTextRange();
                range.collapse(true);
                range.moveEnd('character', selectionEnd);
                range.moveStart('character', selectionStart);
                range.select();
            }
        }

Because this postback can be slower than a typist can put in the letters this can mean text disappears if the user is not careful, so it was decided the use the EnableFilteringOnEnterPressed setting.

I thought that, perhaps, the error could have been caused by all this extra work, but it seems when I add a simple FileExplorer to a different page, the same thing happens.

It may simply be that I have missed something.

Thank you for your help in this matter.

Vessy
Telerik team
 answered on 10 Jun 2013
5 answers
140 views
I have been using the AutoComplete box in a project for a few weeks and it is great.

It seems to have stopped working however. The results still appear below the box but the list does not show text.

You can see in my screenshot that a thin line appears below the box that is tall enough to be showing all of the results. I'm not sure what is going wrong. I think it might have happened when we upgraded from 4.0 to 4.5.

I am using ASP.NET 4.5 with the latest Telerik release on Windows 7. I have tried this in the latest Chrome and IE10.

Thanks for any suggestions!

I should add code:

<telerik:RadAutoCompleteBox ID="natCompleteBox" runat="server" AllowCustomEntry="true" InputType="Text" TextSettings-SelectionMode="Single"></telerik:RadAutoCompleteBox>
 
           List<Org> orgs = service.GetOrgsByType("National");
            natCompleteBox.DataSource = (from s in orgs orderby s.OrgDesc select s.OrgDesc).ToList();
            natCompleteBox.DataBind();
Bozhidar
Telerik team
 answered on 10 Jun 2013
1 answer
135 views
Hi, is it possible to config RadDatePicker to accept dates without dots:
User would like to enter "31012013" in textbox (of RadDatePicker), that would be converted to datetime. (re-format to "31.01.2013" on blur is acceptable, but how to do it?) 

re, Žiga
Princy
Top achievements
Rank 2
 answered on 10 Jun 2013
7 answers
166 views
I am modifying this example to use in my project:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx

how can I preload  "Title Of Courtesy" combobox from code behind at all and also
considering the fact that in my case it is  a web user control ?  Actually in my case user control  is a grid wrapped in user control
but I did  DataSource and DataBind  interface for it, so it works like a regular bindable control in that respect ).

The values in my user control are different depending on EmployeeId and that is why I need to bind it based on row.

What I am looking to do is something like:
 UserControl.DataSource=Business.Employees.GetContactInfoAsList(EpmployeeId)

but having trouble figuring out which event to use to get a hold of usercontrol on add new row click, also for existing records
I am trying to use RadGrid1_DataBound but item.FindControl (UserControlId) returns NULL when
I do foreach on grid items.

Thank you.










Viktor Tachev
Telerik team
 answered on 10 Jun 2013
5 answers
270 views
I have a radgrid that is bound to an EntityDataSource Control.  Everytime I insert a new record I receive the following error: Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: id

Below is my markup.  Any thoughts would be greatly appreciated.  Thanks!

<

 

telerik:RadGrid runat="server" ID="RadGrid2" AllowPaging="True"

 

 

AllowSorting="True" Width="97%" DataSourceID="EntityDataSource1" AllowAutomaticInserts="True"

 

 

AllowAutomaticUpdates="True" ShowStatusBar="True"

 

 

GridLines="None"

 

 

AutoGenerateColumns="False" OnItemCommand="RadGrid2_ItemCommand" >

 

 

<PagerStyle Mode="NumericPages" AlwaysVisible="true" />

 

 

<MasterTableView Width="100%" CommandItemDisplay="Top"

 

 

DataSourceID="EntityDataSource1"

 

 

DataKeyNames="VendorCrewId">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"

 

 

SortExpression="FirstName" UniqueName="FirstName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LastName" HeaderText="LastName" SortExpression="LastName"

 

 

UniqueName="LastName">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Bio" HeaderText="Bio"

 

 

SortExpression="Bio" UniqueName="Bio" ItemStyle-Width="300px" ItemStyle-HorizontalAlign="NotSet">

 

 

<ItemStyle Width="300px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean"

 

 

HeaderText="IsActive" SortExpression="IsActive" UniqueName="IsActive">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridBinaryImageColumn DataField="Image" HeaderText="Image" UniqueName="Upload" ImageAlign="NotSet"

 

 

ImageHeight="80px" ImageWidth="80px" ResizeMode="Fit"

 

 

DataAlternateTextFormatString="Image of {0}">

 

 

<HeaderStyle Width="10%" />

 

 

</telerik:GridBinaryImageColumn>

 

 

<telerik:GridBoundColumn DataField="VendorCrewId" DataType="System.Int32"

 

 

HeaderText="VendorCrewId" ReadOnly="True" Visible="False" SortExpression="VendorCrewId"

 

 

UniqueName="VendorCrewId">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CompanyEntities.CompanyEntityId"

 

 

DataType="System.Int32" HeaderText="Vendor Id"

 

 

SortExpression="CompanyEntities.CompanyEntityId"

 

 

Visible="False">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<EditFormSettings>

 

 

<EditColumn ButtonType="ImageButton" />

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

Maria Ilieva
Telerik team
 answered on 10 Jun 2013
9 answers
351 views
hi,

Can i insert javascript code inside the telerik editor content.
ie. suppose i insert the code
,<script type='text/javascript' language='javascript'> alert("hello");</script>
 inside the editor content.
when i take its html, it should not be
&LT;SCRIPT TYPE='TEXT/JAVASCRIPT' LANGUAGE='JAVASCRIPT'&GT; ALERT("HELLO");&LT;/SCRIPT&GT;

i need to use this script content to alert hello.
i hope u got my purpose.
Marin Bratanov
Telerik team
 answered on 10 Jun 2013
18 answers
444 views
Hi,

I want to create a  telerik radgrid. But am stuck with the itemdatabound.

My current asp code is :

aspx code:



<asp:GridView ID="gvwUserList" runat="server" OnPageIndexChanging="gridView_PageIndexChanging" OnSorting="gridView_Sorting"
                                OnRowDataBound="testGrid_RowDataBound" CellPadding="4" ForeColor="#333333" Font-Size="Smaller" PageSize="12"
                                AllowPaging="True" GridLines="None" Width="900px" AutoGenerateColumns="false" ShowFooter="False" AllowSorting="True">
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Select All" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                                        <HeaderTemplate>
                                            <asp:CheckBox ID="chkHeader" runat="server" onclick="javascript:HeaderClick(this);" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkStatus" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="User Name" HeaderStyle-HorizontalAlign="Left" SortExpression="customername" ItemStyle-HorizontalAlign="Left">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hlkCustomerName" runat="server" ForeColor="#666666"></asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="User ID" SortExpression="userid" ItemStyle-HorizontalAlign="Left" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCustomerID" runat="server" ForeColor="Black" Visible="false"> </asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="User ID" HeaderStyle-HorizontalAlign="Left" SortExpression="email" ItemStyle-HorizontalAlign="Left">
                                        <ItemTemplate>
                                            <asp:Label ID="lblemailaddress" runat="server" ForeColor="Black"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Employment Type" HeaderStyle-HorizontalAlign="Left" SortExpression="employmenttype" ItemStyle-HorizontalAlign="Left">
                                        <ItemTemplate>
                                            <asp:Label ID="lblEmploymentType" runat="server" ForeColor="Black"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="City" HeaderStyle-HorizontalAlign="Left" SortExpression="city" ItemStyle-HorizontalAlign="Left" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCity" runat="server" Visible="false" ForeColor="Black"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="State" HeaderStyle-HorizontalAlign="Left" SortExpression="value" ItemStyle-HorizontalAlign="Left">
                                        <ItemTemplate>
                                            <asp:Label ID="lblState" runat="server" ForeColor="Black"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Phone Number" SortExpression="phonenumber" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:Label ID="lblPhoneNumber" runat="server" ForeColor="Black"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Role Type" HeaderStyle-HorizontalAlign="Left" SortExpression="role" ItemStyle-HorizontalAlign="Left" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lblRoleType" runat="server" ForeColor="Black" Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Status" HeaderStyle-HorizontalAlign="Left" SortExpression="typedescription" ItemStyle-HorizontalAlign="Left" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lblStatus" runat="server" ForeColor="Black" Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EditRowStyle BackColor="Gray" />
                                <HeaderStyle BackColor="#A2A6AF" Font-Bold="True" ForeColor="#990000" />
                                <PagerStyle BackColor="#A2A6AF" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#e5e5e5" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <%--<SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />--%>
                            </asp:GridView>

******************************************************************************************************************************************************************

aspx.cs code :

protected void testGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (Request.QueryString.ToString().Contains("email"))
        {
            email = Request.QueryString["email"].ToString();
            roleid = Request.QueryString["roleid"].ToString();

            email = QueryStringModule.Decrypt(email);
            roleid = QueryStringModule.Decrypt(roleid);
        }


        if (e.Row.RowType == DataControlRowType.DataRow)
        {

            HyperLink userName = ((HyperLink)e.Row.FindControl("hlkCustomerName"));
            Label userId = ((Label)e.Row.FindControl("lblCustomerID"));
            Label emailaddress = ((Label)e.Row.FindControl("lblemailaddress"));
            Label employmenttype = ((Label)e.Row.FindControl("lblEmploymentType"));
            Label city = ((Label)e.Row.FindControl("lblCity"));
            Label state = ((Label)e.Row.FindControl("lblState"));
            Label phonenumber = ((Label)e.Row.FindControl("lblPhoneNumber"));
            Label roletype = ((Label)e.Row.FindControl("lblRoleType"));
            Label status = ((Label)e.Row.FindControl("lblStatus"));

            userName.Text = DataBinder.Eval(e.Row.DataItem, "customername").ToString();

            userId.Text = DataBinder.Eval(e.Row.DataItem, "userid").ToString();
            emailaddress.Text = DataBinder.Eval(e.Row.DataItem, "email").ToString();
            employmenttype.Text = DataBinder.Eval(e.Row.DataItem, "employmenttype").ToString();
            city.Text = DataBinder.Eval(e.Row.DataItem, "city").ToString();
            state.Text = DataBinder.Eval(e.Row.DataItem, "value").ToString();
            phonenumber.Text = DataBinder.Eval(e.Row.DataItem, "phonenumber").ToString();
            roletype.Text = DataBinder.Eval(e.Row.DataItem, "role").ToString();
            status.Text = DataBinder.Eval(e.Row.DataItem, "typedescription").ToString();

            string query = QueryStringModule.Encrypt(email);
            string query1 = string.Empty;
            if (roleid != string.Empty)
                query1 = QueryStringModule.Encrypt(roleid);
            else
                query1 = Request.QueryString["roleid"].ToString();
            string query2 = QueryStringModule.Encrypt(roletype.Text);
            string query3 = QueryStringModule.Encrypt(userId.Text);

            userName.NavigateUrl = Constants.RedirectPages.UserEntry + "?userid=" + query3 + "&roleid=" + query1 + "&email=" + query + "&userRole=" + query2;

        }
}


Here the problem is how to use the findcontrol method in itemdatabound based on my code.


Thank you in advance


Shinu
Top achievements
Rank 2
 answered on 10 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?