Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
146 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
138 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
61 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
173 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
190 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
187 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
297 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
418 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
472 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
6 answers
328 views
Hallo, I'm testing RadCaptcha and I'm struck with a very odd behaviour.
If I use the "Captcha" method (I'm using the cache as storage since I disabled sessions) everything works correctly. If I enter the right code validation passes, otherwise validation fails.
If I use the "InvisibleTextBox" protection instead, validation always fails.
Here is the test string that I'm using, maybe I missed something on it:

<telerik:RadCaptcha ID="RadCaptcha1" ProtectionMode="InvisibleTextBox" MinTimeout="2" ErrorMessage="asdsdasd" Display="Static" runat="server"></telerik:RadCaptcha>

This is inside an asp Panel, together with the form fields, ajaxified with RadAjaxManager.
I check the validation in the button click event server side and RadCaptcha1.IsValid is always false and of course validation fails. Any hint to overcome this issue. I can exploit the invisibletextbox feature myself but the timer on form subit requires a bit more work and it is a pity not to use the built-in one inside RadCaptcha. Any hint will be much appreciated. I'm coding on ASP.NET 4.5.

Massimiliano
Top achievements
Rank 1
 answered on 10 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?