Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
335 views
All I want to do is fire off a command to kick a RadGrid into Add mode on the initial load of a page.

If I put the command RadGrid1.MasterTableView.Items[0].FireCommandEvent("InitInsert", ""); into a button click event it does exactly what I want to do.

If I try to put it into any Grid or page event, it crashes.  None of the examples that I've found so far in the forums seem to work.

Sorry.  Found it.  (Not intuitively obvious....)

protected void RadGrid1_PreRender(object sender, EventArgs e)

{

    RadGrid1.MasterTableView.IsItemInserted = true; // Check for the !IsPostBack also for initial page load

    RadGrid1.Rebind();

}

Boris
Top achievements
Rank 1
 answered on 29 Oct 2012
5 answers
135 views
I've downloaded the RadControlsAJAXCourseware and I am more than a little frustrated.  Every project I've opened appears to have problems.  (Why should I have to add using statements to every web page in every project????)   On the other hand I have to admit that I am more familiar with Web Projects than Websites.

For now I'd like some help with the ObjectDataSourceDemo.  I've copied in our licensed 3.5 dlls to BIN and compiled.  There appears to be a problem with the Tasks.cs file.  If I click on the Object Data Source and try to refresh the schema I get the message 'The type 'ObjectDataSourceDemo.Tasks could not be loaded.  If the type is located in the App_Code folder, please check that it compiles.'  

(Everything appears to compile normally.  So far I've been unable to find a coherent explanation of this problem on the web.)

Kate
Telerik team
 answered on 29 Oct 2012
2 answers
115 views
I am trying to modify the look and feel for the default radgrid.
I have done the embeddedskin and embeddedstylesheet set to false.
i get the header body correct but my pager row for the paging and filter columns gets messed up.
can i get the original css styles that aligns the elements correctly...
Uttam Dhakal
Top achievements
Rank 1
 answered on 29 Oct 2012
2 answers
140 views
Hello experts

i am not understanding where i am wrong please help me ....

i have a radgrid and i need to validate designed control.
am using
<ValidationSettings EnableValidation="true" CommandsToValidate="Update, PerformInsert" ValidationGroup="EditMode />

 <EditItemTemplate>
                                        <telerik:RadDatePicker ID="dtTravelDate" DateInput-DateFormat="MM/dd/yyyy" DateInput-DisplayDateFormat="MM/dd/yyyy"
                                            DbSelectedDate='<%# Eval("Travel_Date") %>' runat="server" CssClass="ClaimDateControl"
                                            Width="100px">
                                        </telerik:RadDatePicker>
                                        <asp:RequiredFieldValidator ID="reqTravelDate" runat="server" ControlToValidate="dtTravelDate"
                                            ErrorMessage="Please Enter Travel Date." Display="None"  ValidationGroup="EditMode"> </asp:RequiredFieldValidator>
                                    </EditItemTemplate>
and so on

and end of the template am using validation summary.

<asp:ValidationSummary ID="summuryEdit" runat="server" ShowMessageBox="true" ShowSummary="false" Enabled="true" ValidationGroup="EditMode"  EnableClientScript="true"/>

please help me its very urgent ...

Mahendra
Top achievements
Rank 1
 answered on 29 Oct 2012
1 answer
118 views
Hi All,
We upgraded to the new version 2012.3.1016 of Telerik controls only to notice that, every time a new image is shown by the rotator, it shifts a few pixels to the left. First, we noticed the problem in IE, while FF was fine. The quick fix was to increase the size of the control by one pixel on all each side (left, right, top and bottom). That solved it for IE, but now the same problem appeared in FF.

Here is the code:
<telerik:RadRotator
    ID="AdRadRotator" runat="server" Width="220px" ItemWidth="218px" ForeColor="White"
    Height="290" ItemHeight="288" FrameDuration="5000" EnableRandomOrder="true"
    RotatorType="SlideShow" EnableEmbeddedSkins="false" WrapFrames="true">
    <ItemTemplate>
        <table cellspacing="0" cellpadding="0" width="100%">
            <tr>
                <td>
                    <a href="<%# Eval("DocURL")%>" target='_new'>
                        <img border="0" alt="" src="../../Member/Common/DisplayAd.aspx?id=<%# Eval("ImgID")%>&Type=A"
                            width="<%# Eval("ImgWidth")%>" height="<%# Eval ("ImgHeight")%>" />
                    </a>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadRotator>

As you can see from the attributes, the fix for IE was to set the Width of the control to 220px, while keeping ItemWidth at 218px, which is the size of the image. Similarly for Height and ItemHeight (this may not have been necessary, but I wanted to have an even border around the image. Later I set the foreground to white and the border disappeared).

This seems to be a bug in the new version of the DLLs. The question for the Telerik team is whether a quick fix exists for both IE and FF, or do we have to roll back to the previous DLLs.

Thanks.
SorinC
Top achievements
Rank 1
 answered on 29 Oct 2012
1 answer
146 views

I have a user control that contains a radio list that on SelectIndexChanged it updates a drop down.

I put together a basic page and add the user control to the page it works fine but when I move the control to inside a radgrid it doesn't work, it will post back but never call the SelectIndexChanged event.


Working code

working.aspx

<TT:ToolTipControl ID="ToolTipEdit" runat="server" />

working.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
    ToolTipEdit.getEditToolTip("POL_TERM_CD", "DataPolTermDropDownlistEdit");
}

User Control


userControl.ascx.cs

public void getEditToolTip(string fieldName, string ddlName)
{
     DataPolTermRadioListBox ccPolTermRadioListBox = new DataPolTermRadioListBox(); //custom radio list
     ccPolTermRadioListBox.ID = "PolTermRadioListBox";
     ccPolTermRadioListBox.AutoPostBack = true;
     ccPolTermRadioListBox.SelectedIndexChanged += new System.EventHandler(updateParent);
     ToolTip.Controls.Add(ccPolTermRadioListBox);
}


Broken Code

brokenPage.aspx

<telerik:RadGrid ID="rgState" Skin="WebBlue" runat="server" OnNeedDataSource="rgState_NeedDataSource"
     AutoGenerateColumns="False" OnPreRender="rgState_PreRender">
     <MasterTableView DataKeyNames="wrtnStPolId" AllowAutomaticUpdates="false" AllowAutomaticDeletes="true"
         AllowAutomaticInserts="false" CommandItemDisplay="Top" AllowMultiColumnSorting="True"
         EditMode="InPlace" GroupLoadMode="Server" Caption="State(s) and Exposure(s)">
         <Columns>
             <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Pol Type Nstd" SortExpression="nonStdPolTypeCd"
                 UniqueName="nonStdPolTypeCd">
                 <ItemTemplate>
                     <asp:Label ID="lblNonStdPolTypeCd" runat="server" align="center" Text='<%#DataBinder.Eval(Container.DataItem, "nonStdPolTypeCd")%>' />
                        
                 </ItemTemplate>
                 <EditItemTemplate>
                     <cc1:DataNonStdTypeCdDropDownList ID="ddlNonStdTypeCd" runat="server" ClientIDMode="Predictable">
                     </cc1:DataNonStdTypeCdDropDownList>
                     <TT:ToolTipControl ID="ttcNonStdPolTypeCdEdit" runat="server" />
                 </EditItemTemplate>
             </telerik:GridTemplateColumn>
         </Columns>
     </MasterTableView>
 </telerik:RadGrid>


brokenPage.aspx.cs

protected void rgState_PreRender(object sender, EventArgs e)
        {
  
            RadGrid rgExpMod = (RadGrid)sender;
  
            foreach (GridDataItem row in rgExpMod.Items)
            {
  
                    GridDataItem gdiItem = (GridDataItem)row;
  
                    if (row.FindControl("ttcNonStdPolTypeCdEdit") != null)
                    {
  
                        DropDownList ddl = (DropDownList)row.FindControl("ddlNonStdTypeCd");
                        ddl.ID += row.RowIndex;
                        ddl.SelectedIndex = 2;
  
                        NCCI.PDC.Web.Controls.ucToolTip ttcNonStdPolTypeCdEdit = (NCCI.PDC.Web.Controls.ucToolTip)row.FindControl("ttcNonStdPolTypeCdEdit");
                        ttcNonStdPolTypeCdEdit.getEditToolTip("non_std_pol_type_cd", ddl.ID);
                          
                    }
            }
  
        }

Milena
Telerik team
 answered on 29 Oct 2012
3 answers
320 views
I'm new to Telerik.  In this case I'm not quite sure what I'm looking for.

I have a bit of ASP.Net sample code that allows me to upload Word docs and stick them into a varbinary(max) field in a SQL Server database.  (I am aware that there's a RadAsyncUpload control but I don't think that's what I'm looking for.)

Are there any Telerik controls or techniques that could help?
Kate
Telerik team
 answered on 29 Oct 2012
7 answers
602 views
I use the following code to display member images:

                <asp:Repeater runat="server" id="Repeater1" DataSourceID="SqlDataSource1">
                    <ItemTemplate>
                        <fieldset class="chatter-picture">
                            <a href="#" onclick='selectChatter("<%#Eval("username") %>")'>
                                <telerik:radbinaryimage runat="server" id="RadBinaryImage1" DataValue='<%#Eval("ImageData") %>'
                                    AutoAdjustImageControlSize="false" Width="67px" Height="50px" ToolTip='<%#Eval("username") %>'
                                    AlternateText='<%#Eval("username") %>' />
                            </a>
                        </fieldset>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <asp:SqlDataSource id="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                SelectCommand="select top 30 username, i.ImageData from aspnet_Users u join member_Image i on i.UserId=u.UserId"></asp:SqlDataSource>

This works fine on my local development machine. However, when I take the code to the production server, where the Telerik Rad Controls for AJAX have also been installed, the images do not show up. How do I troubleshoot this problem on the production server?

Thank you for your time.
Antonio Stoilkov
Telerik team
 answered on 29 Oct 2012
4 answers
440 views
We have found that if you zoom in (CTRL +) or use the zoom menu in Chrome to zoom the drag-n-drop functionality becomes unpredicatble - sometimes it will work and sometimes it won't. IE and Firefox don't seem to have this problem. 

I have been able to recreate this issue in this demo (as well as our app):
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx

If you drag an item to the recycle bin depending on where you drop it - the drop may or may not work. Specifically I have found that there is a point in the middle of the basket where it will fail consistently - when zoomed in a little. In the demo the cursor turns into a hand when the item is over the recycle bin and when that happens the drop usually works. However it seems if you are hovering over the bin and the cursor is still a standard arrow and you drop it - the drop fails and the item is not removed from the grid.

I don't know if this is something that Telerik or anyone other than the Chrome team can fix. Any thoughts, suggestions?
Pavlina
Telerik team
 answered on 29 Oct 2012
1 answer
89 views
Sorry, this belongs in Grid forum, not Editor forum. I'll repost it there.

I have a radGrid that is grouped by a certain text field. When GroupsDefaultExpanded is true (or not specified) clicking the Edit button open the popup form template correctly. But when I set GroupsDefaultExpanded to false, the Edit button no longer opens the editor popup. Clicking the Edit buttons posts back to the server, the ItemCommand event is executed with CommandName equal to "Edit", but then the group collapses itself, and the editor never appears! Clicking the AddItem link does open the editor successfully. If I change nothing more than the value of GroupsDefaultExpanded this behavior appears and disappears, so it is obviously related.
Daniel
Telerik team
 answered on 29 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?