Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
51 views
Hello,

In my project i am using a RadGrid control, when the EditFormType in EditFormSettings is set to "AutoGenerated" and once i click the Edit button, the Edit Form is shown perfectly and working.

Now, i am trying to build a template since i don't need all the data to be edited, i tried to use

<EditColumn UniqueName="EditCommanColumn1"></EditColumn>
                        <FormTemplate>
                            Test
                        </FormTemplate>
                    </EditFormSettings>

And once i click the edit image, the form is not showing

Here's my code

<telerik:RadGrid ID="RadGrid1"  runat="server" ShowStatusBar="True"
       AutoGenerateColumns="False" PageSize="3" AllowSorting="True" AllowMultiRowSelection="False"
       AllowPaging="True" OnItemCreated="RadGrid1_ItemCreated"
       AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" Width="843px"
               onupdatecommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand"
                   GridLines="None" Height="248px">
        
          <MasterTableView DataSourceID="SqlDataSourceGrades" DataKeyNames="StudentID" AllowMultiColumnSorting="True"
           Width="100%" CommandItemDisplay="Top" Name="StudentID">
           <Columns>
                            
           <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    
                    
               <HeaderStyle Width="20px"></HeaderStyle>
               <ItemStyle CssClass="MyImageButton"></ItemStyle>
               </telerik:GridEditCommandColumn>
               <telerik:GridBoundColumn SortExpression="StudentID" HeaderText="ID" HeaderButtonType="TextButton"
                   DataField="StudentID" UniqueName="StudentID" MaxLength="7">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC1" HeaderText="AC1" HeaderButtonType="TextButton"
                   DataField="AC1" UniqueName="AC1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR1" HeaderText="GR1" HeaderButtonType="TextButton"
                   DataField="GR1" UniqueName="GR1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T1" HeaderText="T1" HeaderButtonType="TextButton"
                   DataField="T1" UniqueName="T1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC2" HeaderText="AC2" HeaderButtonType="TextButton"
                   DataField="AC2" UniqueName="AC2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR2" HeaderText="GR2" HeaderButtonType="TextButton"
                   DataField="GR2" UniqueName="GR2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T2" HeaderText="T2" HeaderButtonType="TextButton"
                   DataField="T2" UniqueName="T2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC3" HeaderText="AC3" HeaderButtonType="TextButton"
                   DataField="AC3" UniqueName="AC3">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR3" HeaderText="GR3" HeaderButtonType="TextButton"
                   DataField="GR3" UniqueName="GR3">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T3" HeaderText="T3" HeaderButtonType="TextButton"
                   DataField="T3" UniqueName="T3">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC4" HeaderText="AC4" HeaderButtonType="TextButton"
                   DataField="AC4" UniqueName="AC4">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR4" HeaderText="GR4" HeaderButtonType="TextButton"
                   DataField="GR4" UniqueName="GR4">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T4" HeaderText="T4" HeaderButtonType="TextButton"
                   DataField="T4" UniqueName="T4">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="Sem1" HeaderText="Sem1" HeaderButtonType="TextButton"
                   DataField="Sem1" UniqueName="Sem1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="Sem2" HeaderText="Sem2" HeaderButtonType="TextButton"
                   DataField="Sem2" UniqueName="Sem2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="G" HeaderText="G" HeaderButtonType="TextButton"
                   DataField="G" UniqueName="G">
               </telerik:GridBoundColumn>
               <telerik:GridTemplateColumn>
                    
               <ItemTemplate>
                       
                   <asp:Label ID="lblEvaluate" runat="server"></asp:Label>
                   </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   </Columns>
                   <EditFormSettings EditFormType="Template">
                   <EditColumn UniqueName="EditCommanColumn1"></EditColumn>
                       <FormTemplate>
                           Test
                       </FormTemplate>
                   </EditFormSettings>
                    
                   <SortExpressions>
                
           <telerik:GridSortExpression FieldName="StudentID"></telerik:GridSortExpression>
           </SortExpressions>
            
           </MasterTableView>
           </telerik:RadGrid>

What i am missing?


Many thanks in advance
Zeyad
Top achievements
Rank 1
 answered on 27 Oct 2013
0 answers
99 views
I have an issue with silk skin with radmenu. I click on an item in ajax mode it postback and load fine. But when i click on browser window on any empty place why it lost highlighted item?

watch following video.

http://screencast.com/t/L5Y4jdvxmNwo
Muhammad Imran
Top achievements
Rank 1
 asked on 26 Oct 2013
2 answers
136 views
I have a vertical RadMenu on my page who's button clicks bring up popup windows.

We have a little formula that determines the placement of each window (just to the right of the button clicked), but on IE9, the offsetTop value for the menu item element is off by 60, which pushes down our window lower than we want.  Other browsers display it fine.

Any ideas why?  Here's the menu:
<telerik:RadMenu ID="RadMenu1" runat="server" flow="Vertical" Width="100%" OnClientItemClicked="MenuOpenWindow('RadWindow1')">
    <Items>
        <telerik:RadMenuItem ImageUrl="../Images/button.png" Value="RadWindow1"  />
    </Items>
</telerik:RadMenu>

And Javascript:
function MenuOpenWindow(windowTitle) {
    var oWindow;
    var offsetElementBounds;
    var menu = $find("<%=RadMenu1.ClientID%>");
    var menuItem = menu.findItemByValue(windowTitle).get_element();
 
    if (windowTitle == "RadWindow1") {
        if (lastWindowTitle != "RadWindow1") {
            oWindow = $find("<%=winRadWindow1.ClientID%>");
            oWindow.show();
            if (oWindow.get_offsetElementID()) {
                offsetElementBounds = $telerik.getBounds($get(oWindow.get_offsetElementID()));
                var x = parseInt(offsetElementBounds.x + (menuItem.offsetWidth / 3));
                var y = parseInt(menuItem.offsetTop + offsetElementBounds.y - (menuItem.offsetHeight / 3));
                alert(menuItem.offsetTop);
                alert(offsetElementBounds.y);
                alert(menuItem.offsetHeight);
                alert(x);
                alert(y);
                oWindow.moveTo(x, y);
            }
            return false;
        }
    }
}
Amanda
Top achievements
Rank 1
Iron
 answered on 25 Oct 2013
33 answers
920 views
Hello,

We need to style RadInput (RadTextBox) with rounded corners. The ideal solution of course would be to use FormDecorator, but at this point it does not apply to RadInput. After searching through support forums I found following workaround:

http://www.telerik.com/community/forums/aspnet-ajax/form-decorator/raddatepicker-rounded-corners.aspx

Which basically requires to add following code to each and every RadTextBox present on the page:

<script runat="server">  
  
    protected void Page_PreRenderComplete(object sender, EventArgs e)  
    {  
        if (Request.Browser.IsBrowser("IE"))  
        { 
            RadTextBox1.EnabledStyle.CssClass = String.Empty; 
            RadTextBox1.HoveredStyle.CssClass = String.Empty; 
            RadTextBox1.FocusedStyle.CssClass = String.Empty; 
            RadTextBox1.InvalidStyle.CssClass = String.Empty;  
        }  
        else  
        { 
            RadTextBox1.EnabledStyle.CssClass = "rfdInput rfdRoundedCorners"
            RadTextBox1.HoveredStyle.CssClass = "rfdInput rfdRoundedCorners"
            RadTextBox1.FocusedStyle.CssClass = "rfdInput rfdRoundedCorners"
            RadTextBox1.InvalidStyle.CssClass = "rfdInput rfdRoundedCorners";  
        }  
    } 
     
</script>  

The good thing - it works, not so good - you can imagine what needs to be done if there are multiple RadTextBoxes on multiple pages. Which brings me to my question - is there a better way of handling this? Can this be done by modifying CSS for the Skin that we're using without actually adding any code?

Thank you,
Andrei



Ivan Zhekov
Telerik team
 answered on 25 Oct 2013
0 answers
81 views
Hi 
I m using the rad scheduler with mvc
I m  facing the issue that my Get Appointment method is calling multiple times.
Gaurav
Top achievements
Rank 1
 asked on 25 Oct 2013
2 answers
998 views
Hi,

Is there a way to use the dataformatstring on a gridboundcolumn to display negative numbers in red?

DataType="System.Int16" DataFormatString="{0:#,###,##0;-#,###,##0}"



Thank You
Tracy
Tracy
Top achievements
Rank 1
 answered on 25 Oct 2013
5 answers
308 views
Hello,

I have an application with several pages that contain RadComboBoxes.  When I select an option in the first RadComboBox it triggers the other RadComboBoxes to load options based on that selection.  Or rather, it used to do this.  This application has been working this way for years after having been developed in Visual Studio 2008 targeting the 3.5 .NET framework.  Recently, I tried upgrading this application to the 4.0 .NET framework so I could develop in Visual Studio 2010.  Now the RadComboBoxes will not be updated properly when the 1st one's selected option is changed.

Here is the first combobox:
<telerik:radcombobox id="ebaCountry" runat="server" DataTextField="Text" DataValueField="Value" MarkFirstMatch="True" AllowCustomText="False" OnClientSelectedIndexChanging="LoadCountryDependentCombos" OnItemsRequested="ebaCountry_ItemsRequested" OnClientSelectedIndexChanged="EbaChangeCountry" OnClientBlur="EbaChangeCountry" OnClientLoad="SetCountryClientId"></telerik:radcombobox>

The important attribute here is OnClientSelectedIndexChanging.  It triggers javascript code that should cause other RadComboBoxes to be populated with data.  The javascript looks like this:
var item = eventArqs.get_item();
ebaParticipant.set_text(" Loading...");
ebaParticipant.requestItems(item.get_value(), false);

Here is what the second combobox looks like:
<telerik:RadComboBox runat="server" ID="ebaParticipant" MarkFirstMatch="true" DataSourceID="objdsParticipant" OnClientItemsRequested="ItemsLoaded" AllowCustomText="False" OnClientSelectedIndexChanged="EbaChangeParticipant" OnClientBlur="EbaChangeParticipant" OnItemDataBound="ebaParticipant_ItemDataBound" OnClientLoad="SetParticipantClientId" OnItemsRequested="ebaParticipant_ItemsRequested">
                        <ItemTemplate>
                            <ul>
                                <li style="float: left; width: 110px; margin: 0; padding: 0 5px 0 0; line-height: 14px">
                                    <%# DataBinder.Eval(Container.DataItem, "PersonName") %></li>
                                <li style="float: left; width: 110px; margin: 0; padding: 0 5px 0 0; line-height: 14px">
                                    <%# DataBinder.Eval(Container.DataItem, "MinistryName") %></li>
                            </ul>
                        </ItemTemplate>
</telerik:RadComboBox>

The function in the code-behind, ebaParticipant_ItemsRequested, triggered by the OnItemsRequested event sets up a couple of parameters for ObjectDataSource used by the RadComboBox then calls "ebaParticipant.DataBind()" to fill this second combobox with data based on the selected option in the first combobox. 

While debugging in VS2010 I can step through the code and see that the SelectMethod defined for the ObjectDataSource is being called and I can see the data returned from its database query.  The correct data is being returned.  And here is where something breaks down.  For some reason the second combobox on the web page is no longer being filled with the returned data.  Can anyone suggest a way to debug this step in the process?  Any ideas what's going wrong?  Does it have something to do with the change from .NET 3.5 to 4.0?  I'm using version 2011.1.519.35 of Telerik.Web.UI.dll.

-- Tom 
 
Hristo Valyavicharski
Telerik team
 answered on 25 Oct 2013
4 answers
1.3K+ views
Hi All,
If HTML tags (eg: <<test>>) are entered in the textboxes, throws exception.
This is a problem in asp.net textbox as well. To fix this problem there are two solutions I know:
1) turn of the ValidationRequest.
2) Write a javascript to encrypt/decrypt or replace the tags with &lt; and &gt;
I would like to know if anyone has a better suggestion to resolve this issue.
As turning off validationRequestion opens it for cross-site scripting attacks.
If I try the second option, when the page is rendered and displayed, it shows as &lt; for fraction of seconds and then changes to <. This looks odd to the users. The problem exists both in VS2008/.net3.5 and VS2010/.net4.0
Any suggestions would be highly appreciated.
Thanks,
Richa
Vasil
Telerik team
 answered on 25 Oct 2013
2 answers
203 views
Hi all,

I have created a RadScheduler that uses a TimelineView. I have an issue with the height of the rows. Ideally the height of the rows would match the appointments' height, but it seems it has some other height defined which is much higher than the appointment (see screenshot). When I change the RowHeight property I change the height of the appointment, but not of the entire row. I guess it is somehow related to the grouping.
I feel I've tried changing all height properties I can find, but no success.

How can I make each row be only as high as the appointment (all appointments have a fixed height, so if I can hardcode the rows to be 25px thats fine)?

My markup is shown below:

<div style="clear:both;">
<telerik:RadScheduler runat="server"
    ID="Scheduler"
    DataStartField="Start"
    DataEndField="End"
    DataSubjectField="CustomText"
    DataKeyField="Id"
     
    ShowResourceHeaders="True"
    AllowDelete="False"
    AllowEdit="False"
    AllowInsert="False"
    SelectedView="TimelineView"
    GroupingDirection="Vertical"
    DayStartTime="08:00:00"
    DayEndTime="19:00:00"
    TimeZoneOffset="02:00:00"
    OverflowBehavior="Expand"
    ReadOnly="True"
    RowHeight="25"
    FirstDayOfWeek="Monday"
    LastDayOfWeek="Sunday"
    AppointmentStyleMode="Simple"
    NumberOfHoveredRows="0"
 
    OnAppointmentDataBound="AppointmentDatabound"
    OnResourceHeaderCreated="ResourceCreated"
     
>
    <TimelineView
        GroupingDirection="Vertical"
        SlotDuration="7.00:00:00"
        NumberOfSlots="12"
        ColumnHeaderDateFormat="dd/MM"
        UserSelectable="False" >
    </TimelineView>
    <MonthView UserSelectable="False" />
    <DayView UserSelectable="False" />
    <WeekView UserSelectable="False" />
    <AppointmentTemplate>
        <div >
            <label style="color:black; font-size:7pt; display:block; text-align: center;"><%# Eval("Subject") %></label>
        </div>
    </AppointmentTemplate>
</telerik:RadScheduler>
Michael
Top achievements
Rank 1
 answered on 25 Oct 2013
4 answers
187 views
How do I determine (client-side) if a tile is being moved to a different group?
zAxis
Top achievements
Rank 1
 answered on 25 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?